# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
94153 | bkinik | Go (COCI16_go) | C++14 | 2 ms | 380 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |