1169: 绝对值排序
摘要:解题思路:注意事项:参考代码:while True:
try:
n = list(map(int, input().split()))
a = n[1:]……
绝对值排序(动态内存分配(calloc)
摘要:解题思路:注意事项:参考代码#include<stdio.h>#include<stdlib.h>int main(){ int i,j,n,*p,*t; scanf("%d",&n); while(……
小白随便写的,记录一下
摘要:```python
def solve_sort(li):
new_li = list(map(int, li[1:]))
new_li.sort(key=abs, revers……
1169: 绝对值排序(改编一下sort函数,超方便)
摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;bool cmp(int a,int b);int ma……
用冒泡排序做的,没有时间超限
摘要:解题思路:注意事项:参考代码:while True: li=list(map(int,input().split())) if li[0]==0: break else……
绝对值排序(STL秒了) 不需要用队列
摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>
using namespace std;
bool cmp(int &x,int &y){
return ab……
二维数组,第一列为数字的绝对值,第二列为正负的标志,-1为负,1为正,最后输出时,每行两个数字相乘即可
摘要:解题思路:注意事项:参考代码:import java.util.*;
public class Main {
public static void main(String[] args……
绝对值排序(python)
摘要:解题思路:注意事项:参考代码:while True: nums = list(map(int, input().split())) n = nums[0] if n == 0: ……