| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1358561 | hsuan._.0528 | Infinite Race (EGOI24_infiniterace2) | C++20 | 37 ms | 460 KiB |
#include<bits/stdc++.h>
using namespace std;
#define LL long long
const int maxn = 2e5+10;
int n, q, ans=0;
bitset<maxn> a; // 0 i在前面 / 1 i在後面
signed main(){
ios_base::sync_with_stdio(0); cin.tie(0);
cin>>n>>q;
while(q--){
int x; cin>>x;
if(x<0){
x*=-1;
a[x]=0;
}else{
if(a[x]==1){
ans++;
a.reset();
}
a[x]=1;
}
}
cout<<ans;
return 0;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
