# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
979140 | 2024-05-10T09:38:25 Z | MilosMilutinovic | Lightning Rod (NOI18_lightningrod) | C++14 | 2000 ms | 215660 KB |
#include <bits/stdc++.h> using namespace std; const int MAX = 10000005; int x[MAX], y[MAX], ord[MAX]; bool cmp(int i, int j) { return make_pair(x[i], -y[i]) < make_pair(x[j], -y[j]); } int main() { int n, a, b, i; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d %d", &a, &b); x[i] = a - b; y[i] = a + b; ord[i] = i; } sort(ord, ord + n, cmp); int ans = 0, mx = -1; for (int i = 0; i < n; i++) { if (mx < y[ord[i]]) { ans += 1; mx = y[ord[i]]; } } printf("%d\n", ans); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2049 ms | 215660 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 4440 KB | Output is correct |
2 | Correct | 1 ms | 4444 KB | Output is correct |
3 | Correct | 1 ms | 4444 KB | Output is correct |
4 | Correct | 1 ms | 4444 KB | Output is correct |
5 | Correct | 1 ms | 4444 KB | Output is correct |
6 | Correct | 1 ms | 4444 KB | Output is correct |
7 | Correct | 1 ms | 4444 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 4440 KB | Output is correct |
2 | Correct | 1 ms | 4444 KB | Output is correct |
3 | Correct | 1 ms | 4444 KB | Output is correct |
4 | Correct | 1 ms | 4444 KB | Output is correct |
5 | Correct | 1 ms | 4444 KB | Output is correct |
6 | Correct | 1 ms | 4444 KB | Output is correct |
7 | Correct | 1 ms | 4444 KB | Output is correct |
8 | Correct | 1 ms | 4440 KB | Output is correct |
9 | Correct | 1 ms | 4444 KB | Output is correct |
10 | Correct | 1 ms | 4440 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 4440 KB | Output is correct |
2 | Correct | 1 ms | 4444 KB | Output is correct |
3 | Correct | 1 ms | 4444 KB | Output is correct |
4 | Correct | 1 ms | 4444 KB | Output is correct |
5 | Correct | 1 ms | 4444 KB | Output is correct |
6 | Correct | 1 ms | 4444 KB | Output is correct |
7 | Correct | 1 ms | 4444 KB | Output is correct |
8 | Correct | 1 ms | 4440 KB | Output is correct |
9 | Correct | 1 ms | 4444 KB | Output is correct |
10 | Correct | 1 ms | 4440 KB | Output is correct |
11 | Correct | 2 ms | 4596 KB | Output is correct |
12 | Correct | 1 ms | 4444 KB | Output is correct |
13 | Correct | 1 ms | 4444 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 4440 KB | Output is correct |
2 | Correct | 1 ms | 4444 KB | Output is correct |
3 | Correct | 1 ms | 4444 KB | Output is correct |
4 | Correct | 1 ms | 4444 KB | Output is correct |
5 | Correct | 1 ms | 4444 KB | Output is correct |
6 | Correct | 1 ms | 4444 KB | Output is correct |
7 | Correct | 1 ms | 4444 KB | Output is correct |
8 | Correct | 1 ms | 4440 KB | Output is correct |
9 | Correct | 1 ms | 4444 KB | Output is correct |
10 | Correct | 1 ms | 4440 KB | Output is correct |
11 | Correct | 2 ms | 4596 KB | Output is correct |
12 | Correct | 1 ms | 4444 KB | Output is correct |
13 | Correct | 1 ms | 4444 KB | Output is correct |
14 | Correct | 57 ms | 12372 KB | Output is correct |
15 | Correct | 49 ms | 12116 KB | Output is correct |
16 | Correct | 40 ms | 11356 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2095 ms | 202236 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2049 ms | 215660 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |