Submission #541736

# Submission time Handle Problem Language Result Execution time Memory
541736 2022-03-24T09:45:13 Z nutzu Baloni (COCI15_baloni) C++11
0 / 100
190 ms 7268 KB
#include <iostream>

using namespace std;
long long n,i,s=1,x,x1,v[1000001];
bool v1[1000001];
int main()
{
    cin>>n;
    for(i=1; i<=n; i++)
    {
        cin>>v[i];
    }
    for(i=2; i<=n; i++)
    {
        if(v[i]!=v[i-1]-1)
        {
            if(v1[v[i]]>0)
            {
                v1[v[i]]=0;
                v1[v[i-1]]=1;
            }
            else
            {
                s++;
                v1[v[i-1]-1]=1;
            }
        }
    }
    cout<<s;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Incorrect 1 ms 340 KB Output isn't correct
4 Incorrect 2 ms 340 KB Output isn't correct
5 Incorrect 190 ms 6424 KB Output isn't correct
6 Incorrect 186 ms 7268 KB Output isn't correct
7 Incorrect 147 ms 5948 KB Output isn't correct
8 Incorrect 150 ms 5832 KB Output isn't correct
9 Incorrect 157 ms 6252 KB Output isn't correct
10 Incorrect 186 ms 6476 KB Output isn't correct