제출 #293938

#제출 시각아이디문제언어결과실행 시간메모리
2939387_7_7Go (COCI16_go)C++17
38 / 50
1 ms384 KiB
#include <bits/stdc++.h>

using namespace std;

int n;
int mx;
int cnt;
string s;
string res;
int main()
{
    ios_base::sync_with_stdio(false);

    cin >> n;
    for(int i = 1; i <= n; i ++){
        int x, y;
        cin >> s >> x >> y;
        if((y / x) > mx){
            mx = (y / x);
            res = s;
        }
        if(y >= x) cnt ++, y -= x;
        cnt += (y / (x - 2));
    }
    cout << cnt << "\n" << res << "\n";
}

#Verdict Execution timeMemoryGrader output
Fetching results...