| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1148205 | AbdullahIshfaq | Infinite Race (EGOI24_infiniterace2) | C++20 | 88 ms | 12872 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 998244353
void solve(){
ll n, q, ans = 0, x;
cin >> n >> q;
map<ll,ll> mp;
for(int i = 0; i < q; i ++){
cin >> x;
if(x > 0){
if(mp.find(x) != mp.end() and mp[x] == ans){
ans++;
}
mp[x] = ans;
}
else{
if(mp.find(-x) != mp.end()){
mp.extract(-x);
}
}
}
cout << ans << '\n';
}
int main() {
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int tests = 1;
// cin >> tests;
for(int i = 1; i <= tests; i ++)
solve();
}| # | 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... | ||||
