# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
646097 | Ghosty_v2 | 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 ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
ll n,x;
cin>>n>>x;
ll sum = 0;
for(int i=0;i<n;i++) {
ll a,b,c;
cin>>a>>b;
if (abs(a-b) > x) {
cin>>c;
sum+=c;
}
else{
if (a >= b) {
sum+=a;
}
else {
sum+=b;
}
}
}
cout<<sum<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |