Submission #1110649

#TimeUsernameProblemLanguageResultExecution timeMemory
1110649vjudge1Tuna (COCI17_tuna)C++17
50 / 50
1 ms504 KiB
#include <bits/stdc++.h> using namespace std; int main() { int N,x,H,Z,a,sum=0; cin>>N>>x; for(int i=0;i<N;i++){ cin>>H>>Z; if(abs(H-Z)>x){ cin>>a; sum+=a; } else{ if(H>Z) sum+=H; else sum+=Z; } } cout<<sum; }
#Verdict Execution timeMemoryGrader output
Fetching results...