제출 #869770

#제출 시각아이디문제언어결과실행 시간메모리
869770AriadnaGo (COCI16_go)C++14
36 / 50
1 ms600 KiB

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector < string > pokemon(n);
    vector < int > k(n), m(n);
    for (int i = 0; i < n; ++i) {
        cin >> pokemon[i] >> k[i] >> m[i];
    }
    
    int total = 0, max_evolutions = -1;
    string max_evolved;
    for (int i = 0; i < n; ++i) {
        int ev = m[i] / k[i] + ((2 * (m[i] / k[i]) + (m[i] % k[i])) / k[i]);
        if (ev > max_evolutions) {
            max_evolutions = ev;
            max_evolved = pokemon[i];
        }
        total += ev;
    }
    cout << total << '\n' << max_evolved << '\n';
    
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...