| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1342320 | mantaggez | Infinite Race (EGOI24_infiniterace2) | C++20 | 15 ms | 1216 KiB |
#include <bits/stdc++.h>
using namespace std;
const int nx = 2e5+5;
int n, q, ans;
int b[nx];
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin >> n >> q;
fill(b, b + nx, -1);
while(q--) {
int x; cin >> x;
int idx = abs(x);
if(x > 0) {
if(b[idx] != ans) b[idx] = ans;
else ans++, b[idx] = ans;
}
else {
if(b[idx] == ans) b[idx] = -1;
}
}
cout << ans << '\n';
return 0;
}| # | 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... | ||||
