Submission #87147

#TimeUsernameProblemLanguageResultExecution timeMemory
87147MatesV13Tuna (COCI17_tuna)C++11
50 / 50
2 ms708 KiB
#include <bits/stdc++.h> using namespace std; int n, x, p1, p2, p3, m, v, sum; int main (){ ios::sync_with_stdio(0); cin.tie(0); cin >> n; cin >> x; for (int i=0;i<n;i++){ cin >> p1; cin >> p2; if (p1 < p2){ m = p1; v = p2; } else { v = p1; m = p2; } if (v - m > x){ cin >> p3; sum = sum + p3; } else { sum = sum + v; } } cout << sum; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...