| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1233280 | yixuan19 | Infinite Race (EGOI24_infiniterace2) | C++20 | 43 ms | 9916 KiB |
#include <iostream>
#include <unordered_set>
using namespace std;
int main(){
int N, Q, event;
unordered_set<int> behind;
cin >> N;
cin >> Q;
int laps = 0;
for (int i = 0; i < Q; ++i){
cin >> event;
if (event > 0){
if (behind.find(event) != behind.end()){
behind.clear();
behind.insert(event);
laps++;
}else{
behind.insert(event);
}
}else{
if (behind.find(-event) != behind.end()){
behind.erase(-event);
}
}
}
cout<<laps<<endl;
}| # | 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... | ||||
