# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1023729 | caterpillow | Go (COCI16_go) | C++17 | 1 ms | 600 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pl = pair<ll, ll>;
using pi = pair<int, int>;
#define vt vector
#define f first
#define s second
#define pb push_back
#define all(x) x.begin(), x.end()
#define size(x) ((int) (x).size())
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define ROF(i, a, b) for (int i = (b) - 1; i >= (a); i--)
#define F0R(i, b) FOR (i, 0, b)
#define endl '\n'
const ll INF = 1e18;
const int inf = 1e9;
main() {
cin.tie(0)->sync_with_stdio(0);
int n; cin >> n;
vt<string> names(n);
vt<pl> costs(n);
F0R (i, n) cin >> names[i] >> costs[i].f >> costs[i].s;
ll best = -1;
string name = "";
int ans = 0;
F0R (i, n) {
int cnt = 0;
while (costs[i].s >= costs[i].f) {
costs[i].s -= costs[i].f;
costs[i].s += 2;
cnt++;
}
ans += cnt;
if (cnt > best) name = names[i], best = cnt;
}
cout << ans << endl << name << endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |