제출 #1200940

#제출 시각아이디문제언어결과실행 시간메모리
1200940THXuanInfinite Race (EGOI24_infiniterace2)C++20
100 / 100
67 ms9796 KiB
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <queue> #include <set> #include <map> #define INF 1e9 using namespace std; typedef long long ll; const ll MAXN = 100005; void solve() { int n, q; cin >> n >> q; set<int>v; int ans = 0; while (q--) { int x; cin >> x; if (x < 0) v.erase(-x); else { if (v.count(x)) { ++ans; v.clear(); v.insert(x); } else v.insert(x); } } cout << ans << "\n"; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t = 1;// cin>>t; while (t--) solve(); 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...