Submission #1110757

#TimeUsernameProblemLanguageResultExecution timeMemory
1110757JohanInfinite Race (EGOI24_infiniterace2)C++14
0 / 100
73 ms14064 KiB
#include <bits/stdc++.h> using namespace std; # define int long long void solve() { map < int , int > mp; int n, q, mx = -1; bool flag = 0; cin >> n >> q; while(q--) { int x; cin >> x; if(x < 0) { mp[abs(x)]--; flag = 1; } else mp[x]++; } for(int i = 1; i <= n; i++) { mx = max(mx, mp[i]); } if(!flag) mx--; if(mx < 0) mx = 0; cout << mx << endl; } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int tt = 1; // cin >> tt; while(tt--){ solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...