# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1110626 | vjudge1 | Tuna (COCI17_tuna) | C++17 | 1 ms | 408 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>
#define int long long
using namespace std;
int32_t main () {
int n;
int x;
cin >>n;
cin >>x;
int h[n];
int z[n];
int b[n];
int t=0;
for(int i=0; i<n; i++) {
cin >> h[i];
cin >> z[i];
if(z[i] == h[i]) {
t = t + z[i];
}
else if(z[i]>h[i]) {
if(z[i] - h[i] > x) {
cin >> b[i];
t = t+b[i];
}
else {
t = t + z[i];
}
}
else {
if(h[i] - z[i] > x) {
cin >> b[i];
t = t+b[i];
}
else {
t = t + h[i];
}
}
}
cout << t <<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |