# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
94133 | quoriess | 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>
#include <unistd.h>
#include <set>
#define dbg(x) cout<<#x<<" has a value of: "<<x<<"\n";
typedef long long int lli;
using namespace std;
typedef pair<lli,lli> pii;
int main(){
int n;
cin>>n;
int ttl=0;
vector<string> dizi(n);
vector<pii> prs(n);
for (int i = 0; i < n; i++)
{
cin>>dizi[i];
int a,b;
cin>>a>>b;
prs[i]=pii(a,b);
}
int mx=-1;
string cvb="";
for(int i=n-1;i>=0;i--){
int nb=prs[i].second;
int lc=0;
while(nb>=prs[i].first){
nb-=prs[i].first;
nb+=2;
lc++;
ttl++;
}
if(lc>=mx){
mx=lc;
cvb=dizi[i];
}
}
cout<<ttl<<"\n"<<cvb<<"\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |