# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
899482 | joccccca | Baloni (COCI15_baloni) | C++14 | 136 ms | 17788 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>
#define int long long
using namespace std;
int b[1000001];
int cnt[1000001];
signed main()
{
int n;
cin >> n;
int a[n];
for(int i=0; i < n; i++)cin>>a[i];
for(int i=n-1; i >= 0;i--){
cnt[a[i]]++;
b[i]=cnt[a[i]-1];
}
int rez=0;
for(int i=0; i < n; i++){
if(a[i]==1 || b[i]==0)rez++;
}
cout<<rez;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |