Submission #499509

# Submission time Handle Problem Language Result Execution time Memory
499509 2021-12-28T14:20:21 Z DolzX01 Lampice (COCI21_lampice) C++14
0 / 50
0 ms 204 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,k,a[100],x,y,c=1;
    cin>>n>>k;
    for (int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for (int i=0;i<n;i++)
    {
      for (int j=i+2;j<n;j+=2)
      {
          if ((a[i]==a[j])&&(a[i+1]==a[j+1]))
          {
              c++;
              x=a[i];
              y=a[i+1];
          }
          else
          {
              break;
          }
      }
      if (c>1)
      {
          if(x!=y)
          cout<<c<<endl<<x<<' '<<y;
          else
          cout<<c<<endl<<x;
          break;
      }
    }
    if (c<=1)
    {
        cout<<-1;
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 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 Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -