Submission #1095290

#TimeUsernameProblemLanguageResultExecution timeMemory
1095290vjudge1Infinite Race (EGOI24_infiniterace2)C++17
29 / 100
11 ms2652 KiB
#include <bits/stdc++.h> #define ss second #define pb push_back #define mod 1000000007 #define N 200005 #define INF 1000000000000000005 #define pu push #define ff first #define pint pair<int,int> typedef long long ll; using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin>>n; int t; cin>>t; bool take[n]; int cnt[n]; memset(cnt,0,sizeof(cnt)); memset(take,false,sizeof(take)); while(t--) { int a; cin>>a; if(a>0) { if(take[a]) cnt[a]++; else take[a]=true; } else take[-a]=false; } int ans=0; for(int i=1;i<n;i++) ans=max(ans,cnt[i]); cout<<ans<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...