#include <bits/stdc++.h>
#define intt long long
#define forn(i,n) for(i=0;i<n;i++)
#define rforn(i,n) for(i=n-1;i>=0;i--)
#define FAST_READ ios_base::sync_with_stdio(false)
#define r0 return 0
using namespace std;
intt n,m,k,evo=0,maxi=-1,i,cnt;
int main()
{
string s,maxevo;
cin>>n;
while(n){
cnt=0;
cin>>s;
cin>>m>>k;
while(k>=m){
k-=m;k+=2;
cnt++;
}
if(cnt>maxi){maxevo=s;maxi=cnt;}
evo+=cnt;
n--;
}
cout<<evo<<endl<<maxevo<<endl;
r0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2020 KB |
Output is correct |
2 |
Correct |
0 ms |
2020 KB |
Output is correct |
3 |
Correct |
0 ms |
2020 KB |
Output is correct |
4 |
Correct |
0 ms |
2020 KB |
Output is correct |
5 |
Correct |
0 ms |
2020 KB |
Output is correct |
6 |
Correct |
0 ms |
2020 KB |
Output is correct |
7 |
Correct |
0 ms |
2020 KB |
Output is correct |
8 |
Correct |
0 ms |
2020 KB |
Output is correct |
9 |
Correct |
0 ms |
2020 KB |
Output is correct |
10 |
Correct |
0 ms |
2020 KB |
Output is correct |
11 |
Correct |
0 ms |
2020 KB |
Output is correct |
12 |
Correct |
0 ms |
2020 KB |
Output is correct |
13 |
Correct |
0 ms |
2020 KB |
Output is correct |
14 |
Correct |
0 ms |
2020 KB |
Output is correct |
15 |
Correct |
0 ms |
2020 KB |
Output is correct |
16 |
Correct |
0 ms |
2020 KB |
Output is correct |
17 |
Correct |
0 ms |
2020 KB |
Output is correct |
18 |
Correct |
0 ms |
2020 KB |
Output is correct |
19 |
Correct |
0 ms |
2020 KB |
Output is correct |
20 |
Correct |
0 ms |
2020 KB |
Output is correct |
21 |
Correct |
0 ms |
2020 KB |
Output is correct |
22 |
Correct |
0 ms |
2020 KB |
Output is correct |
23 |
Correct |
0 ms |
2020 KB |
Output is correct |
24 |
Correct |
0 ms |
2020 KB |
Output is correct |
25 |
Correct |
0 ms |
2020 KB |
Output is correct |