# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
315158 | Kesatria_Komodo | Baloni (COCI15_baloni) | C++17 | 121 ms | 7448 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 <cstdio>
int frek[1000001];
int main(){
int N;
scanf("%d" , &N);
int arr[N] , ans = 0;
for (int i = 0 ; i < N ; i++)
scanf("%d" , arr + i);
for (int i = N - 1 ; i >= 0 ; i--){
if (!frek[arr[i] - 1])
++ans;
else
--frek[arr[i] - 1];
++frek[arr[i]];
}
printf("%d\n" , ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |