#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Incorrect |
6 ms |
384 KB |
Output isn't correct |
3 |
Incorrect |
7 ms |
512 KB |
Output isn't correct |
4 |
Incorrect |
8 ms |
512 KB |
Output isn't correct |
5 |
Incorrect |
1793 ms |
37768 KB |
Output isn't correct |
6 |
Incorrect |
1865 ms |
42020 KB |
Output isn't correct |
7 |
Incorrect |
1302 ms |
34724 KB |
Output isn't correct |
8 |
Incorrect |
1415 ms |
34468 KB |
Output isn't correct |
9 |
Incorrect |
1486 ms |
36104 KB |
Output isn't correct |
10 |
Incorrect |
1512 ms |
37592 KB |
Output isn't correct |