| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1341112 | aykhn | Infinite Race (EGOI24_infiniterace2) | C++20 | 66 ms | 9832 KiB |
#include <bits/stdc++.h>
using namespace std;
#define inf 0x3F3F3F3F3F3F3F3F
#define int long long
#define bpc __builtin_popcountll
const int mod = 998244353;
const int MXN = 1e3 + 5;
signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, q, res = 0;
cin >> n >> q;
set<int> b;
while (q--)
{
int x;
cin >> x;
if (x > 0)
{
if (b.find(x) != b.end()) res++, b.clear();
b.insert(x);
}
else
{
if (b.find(-x) != b.end()) b.erase(-x);
}
}
cout << res << '\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... | ||||
