# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
201663 | SamAnd | Tuna (COCI17_tuna) | C++17 | 5 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;
int qq;
int x;
int main()
{
scanf("%d%d", &qq, &x);
int ans = 0;
while (qq--)
{
int a, b;
scanf("%d%d", &a, &b);
if (a > b)
swap(a, b);
if ((b - a) <= x)
ans += b;
else
{
int c;
scanf("%d", &c);
ans += c;
}
}
printf("%d\n", ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |