Submission #631485

#TimeUsernameProblemLanguageResultExecution timeMemory
631485berrGo (COCI16_go)C++17
50 / 50
1 ms340 KiB
#include <bits/stdc++.h> using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin>>n; vector<array<int, 3>> a(n); vector<string> b(n); int sum=0, ma=-1, ind=0; for(int i=0; i<n; i++) { string s; cin>>s; int x, y; cin>>x>>y; int se=0; while(y>=x) { se+=y/x; y=y/x*2+y%x; } b[i]=s; sum+=se; if(se>ma) { ma=se; ind=i; } } cout<<sum<<"\n"; cout<<b[ind]<<"\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...