Submission #1299940

#TimeUsernameProblemLanguageResultExecution timeMemory
1299940tabGo (COCI16_go)C++20
50 / 50
1 ms348 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; void _() { cin >> n; vector<pair<intt,intt>>v; for(intt i = 0; i < n; i++) { string s; intt m, p; cin >> s >> m >> p; pokemons.push_back(s); v.push_back({m, p}); } string c = ""; intt mx = 0, ans = 0; for(intt i = 0; i < n; i++) { intt cnt = 0, m = v[i].fi, p = v[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++ << ": "; _(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...