# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
137088 | KLPP | Tuna (COCI17_tuna) | C++14 | 2 ms | 376 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;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
int main(){
int n;
int X;
scanf("%d %d",&n,&X);
int ans=0;
rep(i,0,n){
int x,y;
scanf("%d %d",&x,&y);
if(max(x,y)-min(x,y)<=X)ans+=max(x,y);
else{
int z;
scanf("%d",&z);
ans+=z;
}
}
printf("%d\n",ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |