Submission #638313

#TimeUsernameProblemLanguageResultExecution timeMemory
638313NeroZeinBaloni (COCI15_baloni)C++14
100 / 100
59 ms3900 KiB
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; int n, ans; int cnt[1000006]; signed main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cin>>n; for(int i=0;i<n;i++){ int x;cin>>x; cnt[x+1] ? cnt[x+1]--:ans++; cnt[x]++; }cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...