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>
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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |