Submission #659999

#TimeUsernameProblemLanguageResultExecution timeMemory
659999ajthelegendcoderTuna (COCI17_tuna)C++17
50 / 50
1 ms304 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n,x; cin >> n >> x; int sum = 0; while(n--){ int a,b; cin >> a >> b; if(abs(a-b) > x){ int c; cin >> c; sum += c; } else { sum += max(a,b); } } cout << sum; }
#Verdict Execution timeMemoryGrader output
Fetching results...