Submission #1110654

#TimeUsernameProblemLanguageResultExecution timeMemory
1110654vjudge1Tuna (COCI17_tuna)C++17
50 / 50
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main(void) { int n, x; cin >> n >> x; int sum = 0; for(int i = 0 ; i < n ; ++i) { int a, b; cin >> a >> b; if(abs(a - b) > x) { int c; cin >> c; sum += c; } else if(a < b) { sum += b; } else { sum += a; } } cout << sum; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...