Submission #1097111

#TimeUsernameProblemLanguageResultExecution timeMemory
1097111Trisanu_DasInfinite Race (EGOI24_infiniterace2)C++17
34 / 100
19 ms3416 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){ 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...