Submission #1120097

#TimeUsernameProblemLanguageResultExecution timeMemory
1120097ezzzayInfinite Race (EGOI24_infiniterace2)C++14
29 / 100
50 ms3752 KiB
#include<bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back const int N=3e5+5; int mp[N], urd[N]; int pm[N]; signed main(){ int n,q; cin>>n>>q; for(int i=0;i<n;i++)urd[i]=-1; int ans=0; while(q--){ int x; cin>>x; if(x<0){ x*=-1; if(urd[x]==1)mp[x]++; urd[x]=1; } else{ if(urd[x]==0){ pm[x]++; ans=max(ans,pm[x]); } urd[x]=0; } } 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...