# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1078311 | horiaboeriu | Infinite Race (EGOI24_infiniterace2) | C++17 | 258 ms | 2008 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <stdlib.h>
#define MAXN 200000
char f[MAXN];//in f[x] este 0 daca x este in fata si 1 daca ea este in fata pe teren
int rez[MAXN];
int main()
{
int n, q, i, x, rez, j;
scanf("%d%d", &n, &q);
rez = 0;
for (i = 0; i < q; i++) {
scanf("%d", &x);
if (x < 0) {
f[-x] = 0;
} else {
if (f[x] > 0) {
rez++;
//acum este in spatele tutror, mai putin a lui x
for (j = 0; j < n; j++) {
f[j] = 0;
}
}
f[x] = 1;
}
}
printf("%d\n", rez);
return 0;
}
컴파일 시 표준 에러 (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... |