Submission #1120098

#TimeUsernameProblemLanguageResultExecution timeMemory
1120098ezzzayInfinite Race (EGOI24_infiniterace2)C++14
29 / 100
38 ms2560 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; int p=-1; 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]++; if(p==x)ans=max(ans,ans+1); ans=max(ans,pm[x]); } urd[x]=0; } p=abs(x); } 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...