Submission #3047422


Source Code Expand

#include<iostream>
using namespace std;

int N
int a[210];

int main(){
  cin >> N;

  for(int i=0;i <N;i++)cin >> a[i];

  int res =0;

  while(true){
    bool odd= false;
  for(int i=0;i<N;i++){
    if(a[i]%2 != 0) odd = true;
  }

  if(odd)break;

  for(int i=0;i<N;i++){
    a[i] = a[i]/2;
  }
  res++;
  }
  cout << res <<endl;
}

Submission Info

Submission Time
Task B - Shift only
User koss
Language C++14 (GCC 5.4.1)
Score 0
Code Size 363 Byte
Status CE

Compile Error

./Main.cpp:5:1: error: expected initializer before ‘int’
 int a[210];
 ^
./Main.cpp: In function ‘int main()’:
./Main.cpp:8:10: error: ‘N’ was not declared in this scope
   cin >> N;
          ^
./Main.cpp:10:31: error: ‘a’ was not declared in this scope
   for(int i=0;i <N;i++)cin >> a[i];
                               ^
./Main.cpp:17:8: error: ‘a’ was not declared in this scope
     if(a[i]%2 != 0) odd = true;
        ^
./Main.cpp:23:5: error: ‘a’ was not declared in this scope
     a[i] = a[i]/2;
     ^