#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int T; cin >> T;
while (T--) {
int N; cin >> N;
vector<pair<int, string>> v;
for (int i = 0; i < N; i++) {
string S; int L; cin >> S >> L;
v.push_back({ L,S });
}
sort(v.begin(), v.end(), greater<>());
cout << v.front().second<<"\n";
}
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 1159๋ฒ - ๋๊ตฌ ๊ฒฝ๊ธฐ (0) | 2021.10.28 |
---|---|
[๋ฐฑ์ค,c++] 1157๋ฒ - ๋จ์ด ๊ณต๋ถ (0) | 2021.10.28 |
[๋ฐฑ์ค,c++] 11562๋ฒ - ๋ฐฑ์๋ก ๋ธ๋ ์ดํฌ (0) | 2021.10.28 |
[๋ฐฑ์ค,c++] 1152๋ฒ - ๋จ์ด์ ๊ฐ์ (0) | 2021.10.28 |
[๋ฐฑ์ค,c++] 1149๋ฒ - RGB๊ฑฐ๋ฆฌ (0) | 2021.10.28 |
[๋ฐฑ์ค,c++] 11444๋ฒ - ํผ๋ณด๋์น์ 6 (0) | 2021.10.28 |
๋๊ธ