# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1110654 | vjudge1 | Tuna (COCI17_tuna) | C++17 | 1 ms | 348 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;
#define int long long
signed main(void)
{
int n, x;
cin >> n >> x;
int sum = 0;
for(int i = 0 ; i < n ; ++i)
{
int a, b;
cin >> a >> b;
if(abs(a - b) > x)
{
int c;
cin >> c;
sum += c;
}
else if(a < b)
{
sum += b;
}
else
{
sum += a;
}
}
cout << sum;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |