Submission #639760

#TimeUsernameProblemLanguageResultExecution timeMemory
639760mannshah1211Tuna (COCI17_tuna)C++14
50 / 50
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n, x; cin >> n >> x; int ans = 0; for(int i = 0; i < n; i++){ int a, b; cin >> a >> b; if(abs(a - b) <= x){ ans += max(a, b); } else{ int c; cin >> c; ans += c; } } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...