Submission #1049264

#TimeUsernameProblemLanguageResultExecution timeMemory
1049264teaInfinite Race (EGOI24_infiniterace2)C++14
100 / 100
56 ms1364 KiB
#include <bits/stdc++.h> //#define ll long long using namespace std; int main() { int n, q; cin >> n >> q; vector <int> pre(n, -1); int tren=0; while(q--) { int x; cin >> x; if (x>0) { if (pre[x]!=tren) pre[x]=tren; else { tren++; pre[x]=tren; } } else { x*=(-1); pre[x]=(-1); } } cout << tren << endl; 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...