Submission #1099349

#TimeUsernameProblemLanguageResultExecution timeMemory
1099349I_FloPPed21Infinite Race (EGOI24_infiniterace2)C++14
100 / 100
92 ms10948 KiB
#include <bits/stdc++.h> using namespace std; map<int,int>m; int n, q, x, r; bool a[200001], b[200001]; int main() { cin >> n >> q; set<int> st; int ind =0; for(int i=1;i<=q;i++) { int x; cin>>x; if(x>0) { if(st.find(x)!=st.end()) { ind++; st.clear(); st.insert(x); } else st.insert(x); } else { st.erase(-x); } } cout <<ind; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...