标签:mil title using nbsp 网络 pre code input name
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 0 Accepted Submission(s): 0
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int a[10000]; int n; cin>>n; for(int i=1;i<=2*n;i++) { cin>>a[i]; } int sum=0; sort(a+1,a+1+2*n); for(int i=1;i<=n;i++) { sum+=(abs(a[i]-a[2*n-i+1])); } cout<<sum<<endl; } return 0; }
杭州电子科技大学程序设计竞赛(2016’12)- 网络同步赛 1007
标签:mil title using nbsp 网络 pre code input name
原文地址:http://www.cnblogs.com/yinghualuowu/p/6217933.html