Submission #499509

#TimeUsernameProblemLanguageResultExecution timeMemory
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...