Submission #1046645

#TimeUsernameProblemLanguageResultExecution timeMemory
1046645biserailievaInfinite Race (EGOI24_infiniterace2)C++14
100 / 100
37 ms1368 KiB
#include<bits/stdc++.h> using namespace std; int main() { int n, q; cin>>n>>q; int A[n]; memset(A, -1, sizeof(A)); int res=0; int x; for(int i=0;i<q;i++) { cin>>x; if(x<=0) { x*=-1; A[x]=-1; } else { if(A[x]!=res) { A[x]=res; } else { res++; A[x]=res; } } } cout<<res<<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...