페이지

11557번: Yangjojang of The Year

https://www.acmicpc.net/problem/11557


$O(tnl)$


#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
pair<int, string> p[100];
int t, n;
int main() {
    cin >> t;
    while (t--) {
        cin >> n;
        for (int i = 0; i < n; i++) cin >> p[i].second >> p[i].first;
        cout << max_element(p, p + n)->second << endl;
    }
    return 0;
}





출제진의 의도를 고려하면 더 나은 풀이를 찾을 수 있다.

$O(tl)$


#include<cstdio>
int t;
int main() {
    for (scanf("%d", &t); t--;)puts("Korea");
    return 0;
}

댓글 없음 :

댓글 쓰기