제출 #499509

#제출 시각아이디문제언어결과실행 시간메모리
499509DolzX01Lampice (COCI21_lampice)C++14
0 / 50
0 ms204 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...