# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
499552 | 2021-12-28T15:29:25 Z | Alisaf9 | Lampice (COCI21_lampice) | C++14 | 1 ms | 204 KB |
#include <iostream> using namespace std; int main() { int n,k,l,c=0,z=1,s=0,q,f; cin>>n>>k; int a[n]={0}; int w[n]={0}; for(int i=0; i<n; i++) { cin>>a[i]; } for(int i=1; i<n;i++) { for(int l=i+1;l<n;l++) { if(a[l]==a[i]) { q=l; f=i; while(f<l) { if(a[q]==a[f]) { c++; w[s]=a[f]; } else { z=0; break; } q++; f++; } if(z==1) break; } if(z==1) break; } if(z==1) { for(int i=0;i<q-f;i++) { cout<<w[i]<<" "; } cout<<"\n"<<c; } else cout<<-1; return 0; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | OK | 1 ms | 204 KB | Checker has crashed |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | OK | 0 ms | 204 KB | Checker has crashed |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | OK | 1 ms | 204 KB | Checker has crashed |
2 | Halted | 0 ms | 0 KB | - |