| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1239698 | AMel0n | Infinite Race (EGOI24_infiniterace2) | C++17 | 13 ms | 1864 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,N) for(ll i = 0; i < N; i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
signed main() {
cin.tie(0); ios::sync_with_stdio(false);
ll N, Q;
cin >> N >> Q;
vector<ll> overtaken(N, -1);
ll lap = 0;
FOR(i, Q) {
ll p;
cin >> p;
if (p > 0) {
if (overtaken[p] != lap) overtaken[p] = lap;
else {
lap++;
overtaken[p] = lap;
}
} else {
overtaken[-p] = -1;
}
}
cout << lap;
}| # | 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... | ||||
