# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
231579 |
2020-05-14T04:01:14 Z |
huangqr |
Baloni (COCI15_baloni) |
C++14 |
|
504 ms |
632 KB |
#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 |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
384 KB |
Output is correct |
3 |
Correct |
7 ms |
384 KB |
Output is correct |
4 |
Correct |
7 ms |
436 KB |
Output is correct |
5 |
Correct |
459 ms |
504 KB |
Output is correct |
6 |
Correct |
504 ms |
632 KB |
Output is correct |
7 |
Correct |
412 ms |
504 KB |
Output is correct |
8 |
Correct |
409 ms |
512 KB |
Output is correct |
9 |
Correct |
435 ms |
384 KB |
Output is correct |
10 |
Correct |
442 ms |
504 KB |
Output is correct |