# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
208865 | MertD014 | Go (COCI16_go) | C++17 | 5 ms | 380 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define pob pop_back
using namespace std;
pair<string,int> d[100];
int a,b,ans,aans,n;
int main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>d[i].first;
cin>>a>>b;
ans=b/a;
b+=ans*(2-a);
while(b>=a){
ans++;
b-=a;
b+=2;
}
d[i].second=ans;
aans+=ans;
}
int mx=INT_MIN,mxi;
for(int i=n-1;i>=0;i--){
if(d[i].second>=mx){
mx=d[i].second;
mxi=i;
}
}
cout<<aans<<endl<<d[mxi].first;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |