# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1049291 | sleepntsheep | Infinite Race (EGOI24_infiniterace2) | C11 | 20 ms | 2000 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
int sgn(int x) {
return x < 0 ? -1 : x > 0 ? 1 : 0;
}
int main() {
int n, q, z = 1;
scanf("%d%d", &n, &q);
static int f[200000] = { 0 }, lap[200000] = { 0 };
for (int x, y, i = 1; i <= q; ++i) {
scanf("%d", &x);
y = x * sgn(x);
if (lap[y] != z) f[y] = 0;
if (sgn(x) == -1) {
f[y] = -1;
lap[y] = z;
} else {
if (f[y] == 1)
++z;
lap[y] = z;
f[y] = 1;
}
}
printf("%d\n", z - 1);
}
컴파일 시 표준 에러 (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... |