# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
74099 | charlies_moo | Go (COCI16_go) | C++14 | 3 ms | 812 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 <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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |