제출 #1223682

#제출 시각아이디문제언어결과실행 시간메모리
1223682asli_bgInfinite Race (EGOI24_infiniterace2)C++20
0 / 100
32 ms1232 KiB
#include<bits/stdc++.h> using namespace std; #define sp <<' '<< #define FOR(i,a) for(int i=0;i<(a);i++) #define FORE(i,a,b) for(int i=(a);i<(b);i++) const int MAXN=2e5+5; int say[MAXN]; signed main(){ int n,q; cin>>n>>q; int ans=0; FOR(i,q){ int el; cin>>el; if(el<0){ el=-el; say[el]--; } else say[el]++; say[el]=max(0,say[el]); //cout<<"here" sp el sp say[el]<<endl; ans=max(ans,say[el]-1); } cout<<ans<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...