题解 1286: 最大配对

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

最大配对——python

解题思路:注意事项:参考代码:n=int(input())L1=list(map(int,input().split()))L2=list(map(int,input().split()))L1.sort()L2=sorted(L2)[::-1]print(sum(abs(L1[i]-L2[i])fo

1286基础解法(Python)

解题思路:最大-最小注意事项:合理运用数据类型简化处理难度参考代码:m=int(input())lst_1=sorted(map(int,input().split()))lst_2=sorted(map(int,input().split()),

1286: 最大配对

importjava.util.*;publicclass最大配对{publicstaticvoidmain(String[]args){Scannersc=newScanner(System.in);intn=sc.nextInt();int[]arrb=newint[n];inttemp=0;in

python最大配对简单解法

摘要:B=[]n=int(input())A=list(map(int,input().split()))A.sort()  #正序排序(小到大)b=list(map(int,input().split()……

P1019-题解(C语言代码)

```c#include#includeinta[10005];intb[10005];voidsort(intn){//主要思路就是排序,题目简单inttemp;for(inti=0;i

P1019-题解(C++代码)

第一眼看过去就有点的像贪心但是貌似还是真是贪心既然题目要求我们绝对值之和最大那么我们每次当前匹配的两个数字之和最大局部到全部就可以推出整体绝对值之和最大那么排序就好了```cpp#include#includeusingnamespacestd;constintN=1e5+10;inta[N],

P1019 (C++代码)

摘要:解题思路:注意事项:参考代码:#include<iostream> #include<algorithm> using namespace std; int a[10050],b[10050];……

P1019 (C++代码)

摘要:解题思路:                要想使差值最大,直接把两个数组排序,最大减最小。                C++里面有一个sort函数,使用非常方面,并且效率也很高,这