Submission #102286

#TimeUsernameProblemLanguageResultExecution timeMemory
102286SirCenessGo (COCI16_go)C++14
50 / 50
4 ms428 KiB
#include <bits/stdc++.h> #define mod 1000000007 typedef long long ll; using namespace std; int n; int main(){ //freopen("baskent.gir", "r", stdin); cin >> n; string ans = ""; int maxx = -1; int top = 0; for (int i = 0; i < n; i++){ string s; int k, m; cin >> s >> k >> m; int num = 0; while (m/k != 0){ int add = m/k; num += add; m -= add*k; m += add*2; } top += num; if (maxx < num){ maxx = num; ans = s; } } cout << top << endl << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...