0
点赞
收藏
分享

微信扫一扫

[辽宁省程序设计竞赛]A 组队分配

sin信仰 2022-06-13 阅读 77

​​A-组队分配_2020 年第一届辽宁省大学生程序设计竞赛 (nowcoder.com)[辽宁省程序设计竞赛]A 组队分配_ioshttps://ac.nowcoder.com/acm/contest/8440/A​​

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

typedef pair<int,string> PII;

int main()
{
int t, n;
string x;
int rank;
cin >> t;

while(t --)
{
vector<PII> v;
cin >> n;
int n2 = 3*n;
for(int i = 0; i < n2; i++){
cin >> x >> rank;
v.push_back({rank, x});
}
sort(v.begin(), v.end());

for(int i = 0; i < n2; i+=3)
{
cout<<"ACM-"<<i/3<<' '<<v[i+2].second<<' '<<v[i+1].second<<' '<< v[i].second;
cout << endl;
}

}
return 0;
}


举报

相关推荐

0 条评论