# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1171582 | Nomio | Baloni (COCI15_baloni) | C++20 | 157 ms | 4088 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];
}
set<int> s;
for(int i = 0; i < n; i++) {
if(s.count(a[i] + 1)) s.erase(a[i] + 1);
s.insert(a[i]);
}
cout << s.size() << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |