# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1276210 | duyanhchupapi | Baloni (COCI15_baloni) | C++20 | 61 ms | 580 KiB |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int n, cnt[N], ans;
int main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//freopen("baloni.inp", "r", stdin);
//freopen("baloni.out", "w", stdout);
cin >> n;
while(n--) {
int h; cin >> h; cnt[h]++;
if(cnt[h+1]) cnt[h+1]--;
else ans++;
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |