# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
597097 | kabika | 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;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, x;
cin >> n >> x;
int tot = 0;
while(n--)
{
int p1, p2;
cin >> p1 >> p2;
if(abs(p2-p1) <= x)
tot += max(p1,p2);
else
{
int p3;
cin >> p3;
tot += p3;
}
}
cout << tot << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |