# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1171585 | Nomio | Baloni (COCI15_baloni) | C++20 | 220 ms | 4032 KiB |
#include<bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
int a[n];
for(int i = 0; i < n; i++) {
cin >> a[i];
}
multiset<int> s;
for(int i = 0; i < n; i++) {
if(s.count(a[i] + 1)) s.erase(s.find(a[i] + 1));
s.insert(a[i]);
}
cout << s.size() << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |