제출 #1136212

#제출 시각아이디문제언어결과실행 시간메모리
1136212yoshiInfinite Race (EGOI24_infiniterace2)C++20
34 / 100
65 ms9796 KiB
#include<bits/stdc++.h> #define ll long long using namespace std; void uwu(){ ll n,q; cin>>n>>q; set<ll> a; ll ans=0; for(ll i=0; i<q; i++){ ll x; cin>>x; if(x>0){ if(a.count(x)==0){ a.insert(x); }else{ a.clear(); a.insert(x); ans++; } }else{ if(a.count(x*(-1))==1) a.erase(x); } } cout<<ans<<"\n"; } int main(){ ios::sync_with_stdio(false); cin.tie(0); ll t=1; //cin>>t; while(t--){ uwu(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...