Submission #74099

# Submission time Handle Problem Language Result Execution time Memory
74099 2018-08-30T05:42:08 Z charlies_moo Go (COCI16_go) C++14
50 / 50
3 ms 812 KB
#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
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 488 KB Output is correct
3 Correct 2 ms 488 KB Output is correct
4 Correct 2 ms 488 KB Output is correct
5 Correct 2 ms 488 KB Output is correct
6 Correct 2 ms 488 KB Output is correct
7 Correct 2 ms 528 KB Output is correct
8 Correct 2 ms 624 KB Output is correct
9 Correct 2 ms 624 KB Output is correct
10 Correct 2 ms 700 KB Output is correct
11 Correct 3 ms 700 KB Output is correct
12 Correct 2 ms 700 KB Output is correct
13 Correct 2 ms 700 KB Output is correct
14 Correct 2 ms 700 KB Output is correct
15 Correct 2 ms 732 KB Output is correct
16 Correct 2 ms 732 KB Output is correct
17 Correct 2 ms 732 KB Output is correct
18 Correct 2 ms 732 KB Output is correct
19 Correct 2 ms 748 KB Output is correct
20 Correct 2 ms 764 KB Output is correct
21 Correct 3 ms 764 KB Output is correct
22 Correct 2 ms 812 KB Output is correct
23 Correct 2 ms 812 KB Output is correct
24 Correct 2 ms 812 KB Output is correct
25 Correct 2 ms 812 KB Output is correct