Submission #1112547

#TimeUsernameProblemLanguageResultExecution timeMemory
1112547vjudge1Baloni (COCI15_baloni)C++17
100 / 100
240 ms592 KiB
#include <bits/stdc++.h> #define int long long using namespace std; int32_t main(){ int n; cin>>n; int ans=n; map<int,int> cikti; for(int i=0; i<n; i++){ int x; cin>>x; if(cikti[x]){ ans--; cikti[x]--; cikti[x-1]++; }else{ cikti[x-1]++; } } cout<<ans<<"\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...