# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
597906 | Devigo | Tuna (COCI17_tuna) | C++14 | 1 ms | 324 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 pb push_back
#define mp make_pair
const int siz = 0;
const int mod = 0;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
int x; cin >> x;
long long val = 0;
while(n--) {
int a, b; cin >> a >> b;
int dif = abs(a-b);
if(dif <= x) {
val += max(a,b);
}
else {
int c; cin >> c;
val += c;
}
}
cout << val << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |