# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1174018 | Nomio | Tuna (COCI17_tuna) | C++20 | 0 ms | 328 KiB |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
int x;
cin >> x;
ll s = 0;
for(int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
if(abs(a - b) > x) {
int c;
cin >> c;
s += c;
} else s += max(a, b);
}
cout << s << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |