Submission #487614

#TimeUsernameProblemLanguageResultExecution timeMemory
487614KazamaHoangTuna (COCI17_tuna)C++14
50 / 50
1 ms320 KiB
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); int n, x, res = 0; cin >> n >> x; for (int i = 1; i <= n; ++ i) { int u, v; cin >> u >> v; if (abs(u - v) <= x) res += max(u, v); else { cin >> u; res += u; } } cout << res; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...