Submission #1110653

#TimeUsernameProblemLanguageResultExecution timeMemory
1110653vjudge1Tuna (COCI17_tuna)C++17
0 / 50
1 ms336 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...