# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
898485 | Blagoj | Baloni (COCI15_baloni) | C++17 | 46 ms | 3916 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define all(x) (x).begin(), (x).end()
const int mxh = 1e6 + 10;
int cnt[mxh];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
int ans = 0;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
if (!cnt[x]) {
ans++;
cnt[x]++;
}
cnt[x - 1]++;
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |