# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
499508 | 2021-12-28T14:18:23 Z | adam | Lampice (COCI21_lampice) | C++14 | 0 ms | 204 KB |
#include <iostream> using namespace std; int main() { int n,k; int p; bool o=0; cin>>n>>k; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; }int sum=0; for(int i=0;i<n;i++){ if(a[i]==a[i-1]){sum++;p=a[i];} if(sum==k){o=1;break;} } if(o==1)cout<<'1'<<endl<<p; else cout<<"-1"; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |