Submission #1097112

#TimeUsernameProblemLanguageResultExecution timeMemory
1097112Trisanu_DasInfinite Race (EGOI24_infiniterace2)C++17
100 / 100
17 ms3420 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int v[200005]; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); int m, n; cin >> m >> n; int mx = 0; while(n--){ int x; cin >> x; if(x > 0){ if(v[x] == mx) v[x] = ++mx; else v[x] = mx; }else if(v[-x] != 0) v[-x]--; } cout << max(mx - 1ll, 0ll) << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...