이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ar array
#define ld long double
const int N = 2e5 + 20;
const int B = 400;
const int M = 200;
const int INF = 1e15;
const int LOG = 63;
const int MOD = 998244353;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,bmi,bmi2,lzcnt,popcnt")
signed main(){ios_base::sync_with_stdio(false);cin.tie(0);
int n, q;
cin>>n>>q;
bitset<N> b;
int ans = 0;
while(q--){
int x;
cin>>x;
if(x > 0){
if(b[x]){
ans++;
b &= 0;
}
b[x] = 1;
}else b[-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... |