| 比赛 | 2024.5.23练习赛 | 评测结果 | WWWWWWWWAA |
|---|---|---|---|
| 题目名称 | Rotate Columns | 最终得分 | 20 |
| 用户昵称 | 郑霁桓 | 运行时间 | 0.000 s |
| 代码语言 | C++ | 内存使用 | 0.00 MiB |
| 提交时间 | 2024-05-23 20:01:33 | ||
#include<bits/stdc++.h>
using namespace std;
long long T,n,m,a[100005],b[100005],s;
int main(){
freopen("happygameT1.in","r",stdin);
freopen("happygameT1.out","w",stdout);
cin>>T;
while(T--){
scanf("%lld%lld",&n,&m);
for(int i=1;i<=n*m;i++){
cin>>a[i];
}
sort(a+1,a+n*m+1);
long long s=0;
for(int i=m*n;i>=m*n-n+1;i--){
s+=a[i];
}
cout<<s<<endl;
}
return 0;
}