Submission #1110709

#TimeUsernameProblemLanguageResultExecution timeMemory
1110709vjudge1Tuna (COCI17_tuna)C++98
50 / 50
1 ms336 KiB
#include <iostream> using namespace std; int main() { int N, x; cin >> N >> x; int toplam = 0; for (int i = 0; i < N; i++) { int H, Z; cin >> H >> Z; if (abs(H - Z) <= x) { toplam += (H > Z ? H : Z); } else { int S; cin >> S; toplam += S; } } cout << toplam << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...