Submission #499454

# Submission time Handle Problem Language Result Execution time Memory
499454 2021-12-28T12:50:51 Z Abito Lampice (COCI21_lampice) C++14
0 / 50
1 ms 204 KB
#include <iostream>

using namespace std;

int main()
{
    int n,k;
    cin>>n>>k;
    int a[n];
    for (int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    int x=0,y=-1;
    bool b=0;
    for (int i=0;i<n-1;i++)
    {
        if (a[i]==a[i+1])
        {
            for (int j=1;j<n-1;j++)
            {
                if (a[j]==a[j+1])
                {
                    x++;
                    y=a[j];
                }
                else
                {
                    b=1;
                    break;
                }
            }
            if (b)
                break;
        }
    }
    if (b)
        cout<<1<<endl<<y;
    else
        cout<<y;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Integer -1 violates the range [1, 1000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Integer -1 violates the range [1, 1000]
2 Halted 0 ms 0 KB -