# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1174039 | selunelle | Tuna (COCI17_tuna) | C++20 | 0 ms | 328 KiB |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ll n,x,i,j,k=0,a,b;
cin>>n>>x;
for(i=0;i<n;i++){
cin>>a>>b;
if(abs(a-b)<=x){
k+=max(a,b);
}else{
cin>>j;
k+=j;
}
}
cout<<k;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |