# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1110629 | vjudge1 | Tuna (COCI17_tuna) | C++17 | 1 ms | 508 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;
int main()
{
int n,i;
cin>>n>>i;
int dan;
int topl=0;
int h[n], z[n];
for(int j; j<n; j++){
cin>>h[j]>>z[j];
if(h[j]>z[j]){
if(h[j]-z[j]<=i) topl+=h[j];
else{
cin>>dan; topl+=dan;
}
}
else{
if(z[j]-h[j]<=i) topl+=z[j];
else{
cin>>dan; topl+=dan;
}
}
}
cout<<topl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |