Submission #94152

#TimeUsernameProblemLanguageResultExecution timeMemory
94152bkinikGo (COCI16_go)C++14
0 / 50
2 ms380 KiB
#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 timeMemoryGrader output
Fetching results...