| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1299939 | tab | Go (COCI16_go) | C++20 | 0 ms | 0 KiB |
#include "bits/stdc++.h"
using namespace std;
#define intt long long
#define fi first
#define se second
const intt mxN = 2e5 + 5;
const intt LG = 20;
const intt inf = 1e18;
intt n;
vector<string> pokemons;
vector<pair<intt,intt>> numbers;
void _() {
cin >> n;
for(intt i = 0; i < n; i++) {
string s;
intt m, p;
cin >> s >> m >> p;
pokemons.push_back(s);
numbers.push_back({m, p});
}
string c = "";
intt mx = 0, ans = 0;
for(intt i = 0; i < n; i++) {
intt cnt = 0, m = numbers[i].fi, p = numbers[i].se;
while(p - m >= 0) {
p -= m;
p += 2;
cnt++;
}
if(cnt > mx) {
mx = cnt;
c = pokemons[i];
}
ans += cnt;
}
cout << ans << endl << c << endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
intt t = 1, buu = 1;
// cin >> t;
while(t--){
// cout << "Case #" << buu++ << ": ";
_();
}
}
