| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1342978 | nathlol2 | Infinite Race (EGOI24_infiniterace2) | C++20 | 16 ms | 2120 KiB |
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, q, ans, f[N];
vector<int> a[N], ff;
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> q;
for(int i = 1;i<=q;i++){
int x; cin >> x;
if(x > 0){
if(f[x]){
while(ff.size()) f[ff.back()] = 0, ff.pop_back();
f[x] = 1;
ff.push_back(x);
++ans;
}
else f[x] = 1, ff.push_back(x);
}else{
if(f[-x]) f[-x] = 0;
}
}
cout << ans;
}| # | 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... | ||||
