| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1362425 | avahw | Infinite Race (EGOI24_infiniterace2) | C++20 | 16 ms | 9800 KiB |
#include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
int n, q;
cin >> n >> q;
int res = 0;
unordered_set<int> ahead;
for(int i = 0; i < q; i++){
int e;
cin >> e;
if(e < 0){
e = abs(e);
if(ahead.find(e) != ahead.end()) ahead.erase(e);
}
else{
// e = abs(e);
if(ahead.find(e) != ahead.end()){
res++;
// cout << "lap after " << i << "\n";
ahead = {};
}
ahead.insert(e);
}
}
cout << res << "\n";
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
