Submission #1136423

#TimeUsernameProblemLanguageResultExecution timeMemory
1136423chinhhoangInfinite Race (EGOI24_infiniterace2)C++20
34 / 100
89 ms10820 KiB
#include <iostream> #include <set> using namespace std; int main() { int n,q; int a[300000]; int cnt=0; set<int> s; cin>>n; cin>>q; int f[300000] = {0}; for(int i=1; i<=q; i++){cin>>a[i];} for(int i=1; i<=q; i++){ if(a[i]>0){ if(s.find(a[i]) == s.end()){ s.insert(a[i]); } else { cnt++; s.clear(); s.insert(a[i]); } } } cout<<cnt; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...