Submission #1047120

#TimeUsernameProblemLanguageResultExecution timeMemory
1047120EntityPlanttInfinite Race (EGOI24_infiniterace2)C++17
0 / 100
10 ms1880 KiB
#include <iostream> using namespace std; const int N = 2e5 + 5; int cnt[N], mx[N]; signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, q, x; cin >> n >> q; while (q--) { cin >> x; if (x < 0) cnt[-x] = max(0, cnt[-x] - 1); else mx[x] = max(mx[x], cnt[x]++); } x = 0; for (int i = 1; i < n; i++) x = max(x, mx[i]); cout << x; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...