# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1174013 | nuutsnoynton | Tuna (COCI17_tuna) | C++20 | 0 ms | 328 KiB |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n, m, r, s, x, y, i, j, ans, t;
cin >> n >> r;
ans =0;
for (i = 1; i <= n; i ++) {
cin >> x >> y;
s = abs(x - y);
if ( s <= r) ans += max(x, y);
else {
cin >> x;
ans += x;
}
}
cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |