Submission #231579

#TimeUsernameProblemLanguageResultExecution timeMemory
231579huangqrBaloni (COCI15_baloni)C++14
100 / 100
504 ms632 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; multiset<int>s; int main(){ ll n,k,ans; cin>>n; ans=n; for(ll i=0;i<n;i++){ cin>>k; auto it=s.find(k); if(it!=s.end()){ s.insert(*it-1); s.erase(it); ans--; } else s.insert(k-1); } cout<<ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...