Submission #231578

#TimeUsernameProblemLanguageResultExecution timeMemory
231578huangqrBaloni (COCI15_baloni)C++14
0 / 100
1865 ms42020 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--; } s.insert(k-1); } cout<<ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...