답안 #94133

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
94133 2019-01-16T11:21:49 Z quoriess Go (COCI16_go) C++14
50 / 50
2 ms 380 KB
#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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 252 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 256 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 256 KB Output is correct
21 Correct 2 ms 380 KB Output is correct
22 Correct 2 ms 256 KB Output is correct
23 Correct 2 ms 256 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 2 ms 376 KB Output is correct