Submission #165694

#TimeUsernameProblemLanguageResultExecution timeMemory
165694itiamTuna (COCI17_tuna)C++11
50 / 50
2 ms392 KiB
#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 timeMemoryGrader output
Fetching results...