Submission #1129717

#TimeUsernameProblemLanguageResultExecution timeMemory
1129717khangrlInfinite Race (EGOI24_infiniterace2)C++20
29 / 100
100 ms18804 KiB
#include<bits/stdc++.h> #define pb push_back using namespace std; int main(){ bool to[200005]={0}; unordered_set <int> s; map <int, int> mp; int n, q; cin>>n>>q; for(int i=1; i<=q; i++){ int e; cin>>e; if(abs(e)==e){ if(to[e]==1){ mp[e]++; } to[e]=1; } else{ e*=-1; to[e]=0; } s.insert(abs(e)); } int ans=0; for(auto par:s){ ans=max(ans, mp[par]); } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...