# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
136802 | RiscadoA | Tuna (COCI17_tuna) | C++14 | 2 ms | 376 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;
const int MAX_N = 20;
const int MAX_X = 10;
int N, X, S;
int main()
{
S = 0;
cin >> N >> X;
for (int i = 0, a, b, c; i < N; ++i) {
cin >> a >> b;
if (b > a) {
if (b - a <= X)
c = b;
else
cin >> c;
} else {
if (a - b <= X)
c = a;
else
cin >> c;
}
S += c;
}
cout << S;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |