제출 #1243012

#제출 시각아이디문제언어결과실행 시간메모리
1243012dxh074Infinite Race (EGOI24_infiniterace2)C++20
100 / 100
312 ms2192 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false); cin.tie(0); ll n, q, x, ans = 0; cin >> n >> q; ll a[n]{}; bool b[n]{}; while(q--) { cin >> x; if (x < 0) b[-x] = false; else { if (b[x]) { ++ans; memset(b, false, sizeof(b)); } a[x] = ans; b[x] = true; } } cout << ans << "\n"; 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...