# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
94153 | bkinik | Go (COCI16_go) | C++14 | 2 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>
using namespace std;
#define pob pop_back
#define mp make_pair
#define pb push_back
#define mid (l+r)/2
#define test printf("test\n")
#define st first
#define nd second
#define superman ios::sync_with_stdio(0);cin.tie(0);
typedef long long ll;
typedef pair<ll,ll> pll;
ll INF = 1e9;
ll mod = 1e9+7;
double pi = acos(-1);
ll l,k,m,n,ans,r;
int main() {
superman
//freopen("anan.gir","r",stdin);
//freopen(".cik","w",stdout);
cin>>n;
string str;
string ansstr;
cin>>str;
ansstr = str;
ll numevo=1;
ll numt=0;
cin>>k>>m;
ll ntt=0;
while(numevo!=0) {
numevo = m/k;
m-=numevo*k;
numt += numevo;
m += numevo*2;
}
// cout<<str<<' '<<numt<<endl;
ans = numt;
ntt = ans;
for(int i=1; i<n; i++) {
cin>>str;
numt=0;
cin>>k>>m;
numevo = 1;
while(numevo!=0) {
numevo = m/k;
m-=numevo*k;
numt += numevo;
m += numevo*2;
}
ntt += numt;
if(numt > ans) ansstr = str,ans = numt;
//cout<<str<<' '<<numt<<endl;
}
cout<<ntt<<endl<<ansstr<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |