답안 #499530

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
499530 2021-12-28T14:54:11 Z DolzX01 Lampice (COCI21_lampice) C++14
0 / 50
1 ms 260 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<<1<<endl<<x;
          break;
      }
    }
    if (c<=1)
    {
        cout<<-1;
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Incorrect 0 ms 204 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 260 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Incorrect 0 ms 204 KB Output isn't correct