# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
450420 | rainboy | Tuna (COCI17_tuna) | C11 | 1 ms | 272 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
int abs_(int a) { return a > 0 ? a : -a; }
int max(int a, int b) { return a > b ? a : b; }
int main() {
int n, x, ans;
scanf("%d%d", &n, &x);
ans = 0;
while (n--) {
int a, b;
scanf("%d%d", &a, &b);
if (abs_(a - b) <= x)
ans += max(a, b);
else {
scanf("%d", &a);
ans += a;
}
}
printf("%d\n", ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |