제출 #1120101

#제출 시각아이디문제언어결과실행 시간메모리
1120101ezzzayInfinite Race (EGOI24_infiniterace2)C++14
100 / 100
55 ms2636 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; int ans=0; while(q--){ int x; cin>>x; if(x>0){ mp[x]=max(mp[x]+1,ans+1); if(mp[x]==ans+2){ ans++; } } else{ mp[-x]=ans; } } 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...