제출 #1231278

#제출 시각아이디문제언어결과실행 시간메모리
1231278PlayVoltzGo (COCI16_go)C++20
50 / 50
1 ms328 KiB
#include <cstdio>
#include <stdio.h>
#include <stdbool.h>
#include <iostream>
#include <map>
#include <vector>
#include <climits>
#include <stack>
#include <string>
#include <queue>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <cctype>
#include <bitset>
#include <iomanip>
#include <cstring>
#include <numeric>
#include <cassert>
#include <random>
#include <chrono>
#include <fstream>
using namespace std;

#define int long long
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second

int32_t main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n, mx=-1, a, b, sum=0;
	string ans, s;
	cin>>n;
	while (n--){
		cin>>s>>a>>b;
		int res=0;
		while (b>=a)b+=2-a, ++res;
		if (res>mx)mx=res, ans=s;
		sum+=res;
	}
	cout<<sum<<"\n"<<ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...