| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1297166 | vedchoudhary | Infinite Race (EGOI24_infiniterace2) | C++20 | 1 ms | 572 KiB |
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using ll = long long;
int main() {
int n,q; cin >> n >> q;
vector<bool> ahead(n,true);
vector<ll> lap(1,0);
while(q--) {
int x; cin >> x;
if(x>0) {
if(ahead[x]) {
ahead[x] = false;
} else {
lap[0]++;
ahead[x] = false;
}
} else {
x = -x;
if(ahead[x]) {
ahead[x] = true;
} else {
ahead[x] = true;
}
}
cout << lap[0] << "\n";
}
cout << lap[0];
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... | ||||
