| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1328914 | avighna | Infinite Race (EGOI24_infiniterace2) | C++20 | 66 ms | 9820 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, q;
cin >> n >> q;
set<int> left;
int ans = 0;
while (q--) {
int x;
cin >> x;
if (x > 0) {
if (!left.contains(x)) {
left.insert(x);
} else {
left = set<int>{x};
ans++;
}
} else {
if (left.contains(-x)) {
left.erase(-x);
}
}
}
cout << ans << '\n';
}| # | 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... | ||||
