# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
165694 | itiam | Tuna (COCI17_tuna) | C++11 | 2 ms | 392 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 <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int main(){
int N,X,A,B,C,D,uk=0;
cin >> N >> X;
for (int i=0;i<N;i++){
cin >> A >> B;
if (A>B){
D=A;
A=B;
B=D;
}
//cout << "A,B: " << A << " " << B << "\n";
if (B-A<=X) uk+=B;
else{
cin >> C;
uk+=C;
}
//cout <<"uk: " << uk << "\n";
}
cout << uk;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |