Submission #499528

#TimeUsernameProblemLanguageResultExecution timeMemory
499528Alisaf9Lampice (COCI21_lampice)C++14
0 / 50
0 ms204 KiB
#include <iostream> using namespace std; int main() { int n,k,l,c=0; cin>>n>>k; int a[n+10]; bool z[n]; for(int i=0;i<n;i++) { cin>>a[i]; } for(int i=0;i<n;i++) { while(a[i]=a[i-1]) { c++; } if(c==k) { cout<<1<<"\n"<<a[i]; break; } } return 0; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:17:19: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   17 |         while(a[i]=a[i-1])
      |               ~~~~^~~~~~~
Main.cpp:7:13: warning: unused variable 'l' [-Wunused-variable]
    7 |     int n,k,l,c=0;
      |             ^
Main.cpp:10:10: warning: unused variable 'z' [-Wunused-variable]
   10 |     bool z[n];
      |          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...