# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
784090 | rainboy | Lightning Rod (NOI18_lightningrod) | C11 | 1786 ms | 225936 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>
#define N 10000000
int main() {
static int qu[N], ll[N], rr[N];
int n, cnt, i, x, y;
scanf("%d", &n);
cnt = 0;
for (i = 0; i < n; i++) {
scanf("%d%d", &x, &y);
ll[i] = x - y, rr[i] = x + y;
if (cnt == 0 || rr[qu[cnt - 1]] < rr[i]) {
while (cnt && ll[qu[cnt - 1]] >= ll[i])
cnt--;
qu[cnt++] = i;
}
}
printf("%d\n", cnt);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |