# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1126241 | william889 | Infinite Race (EGOI24_infiniterace2) | C++20 | 56 ms | 1196 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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |