# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1171576 | javkhlantogs | Baloni (COCI15_baloni) | C++20 | 232 ms | 7440 KiB |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ll n,i,j,k,cnt=0;
cin>>n;
vector<ll> h(n);
map<ll,ll> mp;
for(i=0 ; i<n ; i++){
cin>>h[i];
if(mp[h[i]+1]>0){
mp[h[i]+1]--;
mp[h[i]]++;
}
else{
mp[h[i]]++;
cnt++;
}
}
cout<<cnt;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |