Submission #397492

#TimeUsernameProblemLanguageResultExecution timeMemory
397492AlmaGo (COCI16_go)C++17
50 / 50
1 ms316 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, k, m, evo, ans = 0; string name; pair<int, string> maxPoke = {0, "0"}; cin >> n; while (n--) { cin >> name >> k >> m; evo = 0; while (m >= k) { evo += m/k; m = m%k + (m/k)*2; } if (evo > maxPoke.first) maxPoke = make_pair(evo, name); ans += evo; } cout << ans << '\n' << maxPoke.second << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...