# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
87147 | MatesV13 | Tuna (COCI17_tuna) | C++11 | 2 ms | 708 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 n, x, p1, p2, p3, m, v, sum;
int main (){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
cin >> x;
for (int i=0;i<n;i++){
cin >> p1;
cin >> p2;
if (p1 < p2){
m = p1;
v = p2;
}
else {
v = p1;
m = p2;
}
if (v - m > x){
cin >> p3;
sum = sum + p3;
}
else {
sum = sum + v;
}
}
cout << sum;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |