Submission #899482

# Submission time Handle Problem Language Result Execution time Memory
899482 2024-01-06T09:37:06 Z joccccca Baloni (COCI15_baloni) C++14
0 / 100
136 ms 17788 KB
#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
1 Incorrect 1 ms 2392 KB Output isn't correct
2 Incorrect 1 ms 2396 KB Output isn't correct
3 Incorrect 1 ms 2396 KB Output isn't correct
4 Incorrect 1 ms 2396 KB Output isn't correct
5 Incorrect 136 ms 16636 KB Output isn't correct
6 Incorrect 131 ms 17788 KB Output isn't correct
7 Incorrect 112 ms 16080 KB Output isn't correct
8 Incorrect 98 ms 15792 KB Output isn't correct
9 Incorrect 132 ms 16188 KB Output isn't correct
10 Incorrect 130 ms 16588 KB Output isn't correct