Submission #1042248

#TimeUsernameProblemLanguageResultExecution timeMemory
1042248biserailievaBaloni (COCI15_baloni)C++14
100 / 100
33 ms4052 KiB
#include <bits/stdc++.h> using namespace std; const int mxh=1000005; int cnt[mxh]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin>>n; int res=0; for(int i=0;i<n;i++) { int x; cin>>x; if(cnt[x]==0) { res++; } else { cnt[x]--; } cnt[x-1]++; } cout<<res; }
#Verdict Execution timeMemoryGrader output
Fetching results...