제출 #1276227

#제출 시각아이디문제언어결과실행 시간메모리
1276227AlmontherInfinite Race (EGOI24_infiniterace2)C++20
0 / 100
13 ms5128 KiB
#include<bits/stdc++.h> #define ll long long #define co cout<< using namespace std; // stuff void solve(){ ll n,q; cin>>n>>q; ll a[n+5]={},ans[n+5]={},mx=0,ex[n+5]={}; memset(a,-1,sizeof(a)); while(q--){ ll x; cin>>x; if(x<0){ x=-x; if(a[x]==0) ex[x]++; a[x]=0; } else{ ans[x]+=ex[x]; ex[x]=0; if(a[x]==1) ans[x]++; a[x]=1; } mx=max(mx,ans[x]); } co mx; } int main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); int _=1; // cin>>_; while(_--) 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...