# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
231579 | huangqr | Baloni (COCI15_baloni) | C++14 | 504 ms | 632 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |