// 11'52"
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
cin >> n;
vector<pair<int,string>> qian;
vector<pair<int,string>> hou;
for(int i = 1; i <= n / 2; ++ i)
{
int tmp;
string s;
cin >> tmp >> s;
qian.push_back({tmp,s});
}
for(int i = 1; i <= n / 2; ++ i)
{
int tmp;
string s;
cin >> tmp >> s;
hou.push_back({tmp,s});
}
for(int i = 0; i < qian.size(); ++ i)
{
int nowgend = qian[i].first;
cout << qian[i].second << " ";
for(int j = hou.size() - 1; j >= 0; -- j)
{
if(hou[j].first != nowgend && hou[j].first != 114)
{
cout << hou[j].second;
hou[j].first = 114;
break;
}
}
if(i != qian.size() - 1) cout << endl;
}
return 0;
}
标签:tmp,15,cout,qian,int,hou,L1,030,first
From: https://www.cnblogs.com/Frodnx/p/18335887