# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
397615 | victoriad | 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 <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <utility>
#include <queue>
#include <map>
#include <iomanip>
#include <fstream>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
int n,x,a,b,c,r=0;
cin>>n>>x;
for(int i=0;i<n;i++){
cin>>a>>b;
int y=abs(a-b);
if(y<=x){
r+=max(a,b);
}
else{
cin>>c;
r+=c;
}
}
cout<<r;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |