Submission #1126245

#TimeUsernameProblemLanguageResultExecution timeMemory
1126245william889Infinite Race (EGOI24_infiniterace2)C++20
100 / 100
53 ms1196 KiB
# include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n>>m; vector<int>v(n,-1); int t=0; for(int i=0;i<m;i++){ int k; cin>>k; if(k>0){ if(v[k]==t){ t++; v[k]=t; } else{ v[k]=t; } } else{ v[-1*k]=-1; } } cout<<t; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...