Submission #74099

#TimeUsernameProblemLanguageResultExecution timeMemory
74099charlies_mooGo (COCI16_go)C++14
50 / 50
3 ms812 KiB
#include <cstdio> #include <iostream> #include <algorithm> #include <string> using namespace std; int main() { int n,k[80],m[80],count_=0,max_=0; string p[80],maxs; cin>>n; for(int i=1;i<=n;i++) { cin>>p[i]>>k[i]>>m[i]; } for(int i=1;i<=n;i++) { int temp=0; while(m[i]>=k[i]) { int t=(m[i]/k[i]); m[i]-=(k[i]*t); temp+=t; m[i]+=(2*t); } if(max_<temp) max_=temp,maxs=p[i]; count_+=temp; } cout<<count_<<endl<<maxs; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...