# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
487614 | KazamaHoang | Tuna (COCI17_tuna) | C++14 | 1 ms | 320 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;
int main() {
cin.tie(0)->sync_with_stdio(0);
int n, x, res = 0;
cin >> n >> x;
for (int i = 1; i <= n; ++ i) {
int u, v;
cin >> u >> v;
if (abs(u - v) <= x) res += max(u, v);
else {
cin >> u;
res += u;
}
}
cout << res;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |