11557๋ฒ: Yangjojang of The Year
์ ํ OT๋ ๋๊ตฌ๋ณด๋ค๋ ๋จ๋ค๋ฅด๊ฒ ๋์๋ ๋น์ ์ ์์ฐ์ค๋ฝ๊ฒ 1ํ๋ ๊ณผ๋๋ฅผ ์ญ์ํ๊ฒ ๋์๋ค. ํ๊ต์์ ์กฐ์ธํธ ์ ํฐ๋ฅผ ๊ธฐํํ๋ ค๋ ๋น์ ์ ๊ทผ์ฒ์ ์๋ ํ๊ต ์ค ์ด๋ ํ๊ต๊ฐ ์ ์ ๊ฐ์ฅ ๋ง์ด ๋จน๋์ง
www.acmicpc.net
#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 |
๋๊ธ