# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
858479 | ily2003 | Baloni (COCI15_baloni) | C++14 | 43 ms | 7508 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;
int n,ans,a[1000001],dp[1000001];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i=1;i<=n;++i) cin >> a[i];
for (int i=1;i<=n;++i) {
if (dp[a[i]]==0) ++ans,++dp[a[i]];
--dp[a[i]];
++dp[a[i]-1];
}
cout << ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |