제출 #1235174

#제출 시각아이디문제언어결과실행 시간메모리
1235174ceresnaInfinite Race (EGOI24_infiniterace2)C++20
100 / 100
23 ms464 KiB
#include<bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios_base::sync_with_stdio(false); long long n, q; cin >> n >> q; vector<bool> bezci(n, false); // false ak su pred, true ak su za long long lap = 0; for (long long i = 0; i < q; i++) { long long a; cin >> a; if (a < 0) bezci[-a] = false; else if (bezci[a]) { bezci.clear(); bezci.resize(n, false); bezci[a] = true; lap++; } else bezci[a] = true; } cout << lap << '\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...