| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1329062 | liptonek | Infinite Race (EGOI24_infiniterace2) | C++20 | 14 ms | 1476 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n,q;
cin>>n>>q;
vector<bool> behind(n,false);
vector<int> indices;
long long total=0;
for(int i=0; i<q; i++)
{
int x;
cin>>x;
if(x>0)
{
if(behind[x])
{
total++;
for(int idx : indices)
{
behind[idx]=false;
}
indices.clear();
}
if(!behind[x])
{
behind[x]=true;
indices.push_back(x);
}
}
else
{
int target=-x;
behind[target]=false;
}
}
cout<<total<<endl;
return 0;
}
| # | 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... | ||||
