Problem:


Score : 100 points

Problem Statement

Snuke has a grid consisting of three squares numbered 1, 2 and 3.
In each square, either 0 or 1 is written. The number written in Square i is s_i.

Snuke will place a marble on each square that says 1.
Find the number of squares on which Snuke will place a marble.

Constraints

Each of s_1, s_2 and s_3 is either 1 or 0.

Input

Input is given from Standard Input in the following format:

s_{1}s_{2}s_{3}

Output

Print the answer.

Sample Input 1

101

Sample Output 1

2

A marble will be placed on Square 1 and 3.

Sample Input 2

000

Sample Output 2

0

No marble will be placed on any square.



Sample input:
101


Sample output:
2

Submission status: Runtime Error

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
n_operation = 0
for i in range(n):
    even_len = len([a for a in a_list if a % 2 == 0])
    if len(a_list) != even_len:
        print(n_operation)
        exit()
    else:
        a_list = [a / 2 for a in a_list]
        n_operation += 1

print(n_operation)

Submission status: Runtime Error

Solution code:
n = int(input())
a_list = list(map(int, input().split())) # list()を忘れずに

def odd_detector(a_list):
    is_odd = 0
    for a_i in a_list:
        if a_i % 2 == 1:
            is_odd = 1
            break
    return is_odd

n_division = 0
while odd_detector(a_list) == 0:
    a_list = [a / 2 for a in a_list]
    n_division += 1

print(n_division)

Submission status: Runtime Error

Solution code:
n = int(input())
a_list = list(map(int, input().split())) # list()を忘れずに

n_division = 0

def odd_detector(a_list):
    is_odd = 0
    for a_i in a_list:
        if a_i % 2 == 1:
            is_odd = 1
            break
    return is_odd

while odd_detector(a_list) == 0:
    a_list = [int(a/2) for a in a_list]
    n_division += 1

print(n_division)

Submission status: Runtime Error

Solution code:
n = int(input())
a_list = list(map(int, input().split())) # list()を忘れずに

n_division = 0

def odd_detector(a_list):
    is_odd = 0
    for a_i in a_list:
        if a_i % 2 == 1:
            is_odd = 1
            break
    return is_odd

while odd_detector(a_list) == 0:
    a_list = [a/2 for a in a_list]
    n_division += 1

print(n_division)

Submission status: Runtime Error

Solution code:
# 初見不正解：RE (Runtime Error)
n = int(input())
a_list = list(map(int, input().split())) # list()を忘れずに

n_division = 0
is_odd = 0

def odd_detector(a_list):
    for a_i in a_list:
        if a_i % 2 == 1:
            is_odd = 1
            break
    return is_odd

while odd_detector(a_list) == 0:
    a_list = [a/2 for a in a_list]
    n_division += 1

print(n_division)

Submission status: Runtime Error

Solution code:
n = int(input())
a_list = list(map(int, input().split())) # list()を忘れずに

n_division = 0
is_odd = 0

def odd_detector(a_list):
    for a_i in a_list:
        if a_i % 2 == 1:
            is_odd = 1
            break
    return is_odd

while odd_detector(a_list) == 0:
    alist = [a/2 for a in a_list]
    n_division += 1
    
print(n_division)

Submission status: Runtime Error

Solution code:
_ = input()
num_list = input().split(" ")
num_list = list(map(lambda x:int(x), num_list))
 
shift_counter = 0
 
while(True):
  if sum(num_list) % 2 != 0:
    break
  
  num_list = [x / 2 for x in num_list]
  shift_counter += 1
 
print(shift_counter)

Submission status: Runtime Error

Solution code:
_ = input()
num_list = input().split(" ")
num_list = list(map(lambda x:int(x), num_list))
 
shift_counter = 0
 
while(True):
  print(num_list)
  if sum(num_list) % 2 != 0:
    break
  
  num_list = [x / 2 for x in num_list]
  shift_counter += 1
 
print(shift_counter)

Submission status: Runtime Error

Solution code:
_ = input()
num_list = input().split(" ")
num_list = list(map(lambda x:int(x), num_list))
min_num = min(num_list)

shift_counter = 0

while(True):
  if min_num == 1:
    break
  
  min_num /= 2
  shift_counter += 1

print(shift_counter)

Submission status: Runtime Error

Solution code:
s = input()
sum = 0
for i in range(0,len[s]):
	sum += int(s[i])
return(sum)

Submission status: Runtime Error

Solution code:
s = input()
sum = 0
for i in range(0,len[s]):
	sum += i
return(sum)

Submission status: Runtime Error

Solution code:
a = str(input())

count = 0

for s in a:
  if int(s) == 1:
    count++
print(count)

Submission status: Runtime Error

Solution code:
N = input()
A = list(map(int, input().split()))
cnt = 0
while all(a%2==0 for a in A):
    A = [a/2 for a in A]
    cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
n = input()
A = list(map(int, input().split()))
c = 0
while all(a%2==0 for a in A):
    A = [a/2 for a in A]
    c += 1
print(c)

Submission status: Runtime Error

Solution code:
n=int(input())
A=list(map(int,input().split()))
c=0
while(all([a%2==0 for a in A])):
    A = list(map(lambda i:i//2, A))
    c+=1
print(c)

Submission status: Runtime Error

Solution code:
A=int(input())
B=input().split()
ans=111111111
for i in range(A):
    C=B[i]
    cnt=0
    while C%2==0:
        C//=2
        cnt+=1
    if ans>cnt:
        ans=cnt
print(ans)

Submission status: Runtime Error

Solution code:
A=input()
cnt=0
if A[0]=='1':
    cnt++
if A[1]=='1':
    cnt++
if A[2]=='1':
    cnt++
print(cnt)

Submission status: Runtime Error

Solution code:
a = list(str(int(input)))
print(a.count("1"))

Submission status: Runtime Error

Solution code:
import math

n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Submission status: Runtime Error

Solution code:
s = string(input())
print(s.count('1'))

Submission status: Runtime Error

Solution code:
s = strings(input())
print(s.count('1'))

Submission status: Runtime Error

Solution code:
#codigng: utf-8
from sys import stdin

bin  = list(stdin.readline().rstrip())
one = [x for x in bin if x == '1']

print(len(one)

Submission status: Runtime Error

Solution code:
def num_2n(i):
    count = 0
    while(i % 2 == 0):
        i = i / 2
        count += 1
    return count



def main():
    num_ans = int(input())
    ans_list = list(map(int, input().split()))
    num_2n_list =[]
    for i in ans_list:
        num_2n_list.append(num_2n(i))
    num_2n_list.sort()
    num_2n_list.reverse()
    print(num_2n_list[0])


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def num_2n(i):
    count = 0
    while(i % 2 == 0):
        i = i / 2
        count += 1
    return count



def main():
    num_ans = int(input())
    ans_list = list(map(int, input().split()))
    num_2n_list =[]
    for i in ans_list:
        num_2n_list.append(num_2n(i))
    num_2n_list.sort()
    num_2n_list.reverse()
    print(num_2n_list)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
number = int(input())
num_list = list(map(int, input().split()))

count = 0
for i in num_list:
  if i % 2 == 0:
    count += 1
    # print(count)
  else:
    print(0)
    break

count_s = 0
if count == number:
  num_min = min(num_list)
  while num_min % 2 == 0:
    num_min = num_min / 2
    count_s += 1
  print(count_s)

Submission status: Runtime Error

Solution code:
number = int(input())
num_list = list(map(int, input().split()))

count = 0
for i in num_list:
  if i % 2 == 0:
    count += 1
    # print(count)
  else:
    print(0)
    break

count_s = 0
if count == number:
  num_min = min(num_list)
  while True:
    num_min = num_min / 2
    count_s += 1
    if num_min == 1:
      print(count_s)
      break

Submission status: Runtime Error

Solution code:
line = int(intput())
print(line.count('1'))

Submission status: Runtime Error

Solution code:
s = list(map(int,input().split()))
cnt=0
for i in range(3):
    if s[i]==1:
        cnt+=1
print(cnt)

Submission status: Runtime Error

Solution code:
input = input()
num = 0

for i in range(2):
  if (input[i] == 1):
    num++

print(i)

Submission status: Runtime Error

Solution code:
input = input()
num = 0

for i in range(3):
  if (input[i] == 1):
    num++

print(i)

Submission status: Runtime Error

Solution code:
int x = input()
if x/100==1:
    ans++
if x/10==1:
    ans++
if x/1 == 1:
    ans++
print ans

Submission status: Runtime Error

Solution code:
digits = input('')
count = 0
if digits[0] == 1:
  count++
if digits[1] == 1:
  count++
if digits[2] == 1:
  count++
print count

Submission status: Runtime Error

Solution code:
import numpy as np
n = input()
a = map(int, raw_input().split())
max_i = np.argmax(a)
min_i = np.argmin(a)
ans = []
if abs(a[max_i]) >= abs(a[min_i]):
    for i in range(n):
        ans.append((max_i, i))
    for i in range(n-1):
        ans.append((i, i+1))
else:
    for i in range(n):
        ans.append((min_i, i))
    for i in range(n-1, 0, -1):
        ans.append((i, i-1))
print len(ans)
for x, y in ans:
    print (x+1), (y+1)

Submission status: Runtime Error

Solution code:
https://beta.atcoder.jp/contests/abc081/tasks/abc081_a

Submission status: Runtime Error

Solution code:
n = list(map(int, input()))
count = 0
for i in range n: if i == 1: count += 1
print(count)

Submission status: Runtime Error

Solution code:
import std.stdio, std.string, std.conv, std.range, std.string, std.array;
 
void main(){
  auto ip = readln.chomp;
  writeln(ip.count('1'));
}

Submission status: Runtime Error

Solution code:
def abe(n):
    count = 0
    while n % 2 ==0:
        n = n / 2
        count += 1
    return count

x = int(input())
y = map(int,input().split())
z = min(map(abe,y))
print(z)

Submission status: Runtime Error

Solution code:
a = str(input())
b=0
for c in range(3):
	if a[c]=='1':
		b++
print(b)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))

counter = 0

while True:
    exist_odd = False

    for i in range(n):
        if (a[i] % 2 != 0):
            exist_odd = True

    if exist_odd:
        break

    for i in range(n):
        a[i] = a[i] // 2

    counter += 1

print(counter)

Submission status: Runtime Error

Solution code:
 print(input().count("1"))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

def main():
    input_char_list = list(raw_input("type 3 digits number using only 0 or 1: "))
    count = 0
    for char in input_char_list:
        if char == '1':
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=0
a_max=max(a)
a_min=min(a)
if a_min>=0:
    adding=a_max
elif a_min<0 and a_max>0:
    if abs(a_max)>=abs(a_min):
        adding=a_max
    else:
        adding=a_min
else:
    adding=a_min
ind=a.index(adding)
proc=[]
for i in range(n):
    ans+=1
    a[i]+=adding
    proc.append([ind+1,i+1])
for i in range(n-1):
    ans+=1
    a[i+1]+=a[i]
    proc.append([i+1,i+2])
print(ans)
for i in range(len(proc)):
    print(proc[i][0],proc[i][1])

Submission status: Runtime Error

Solution code:
import numpy as np
l = int(input())
a = [ np.int(x) for x in input().split() ]
a = np.array(a, dtype = 'int32')
ans = 0
while True:
    b =  a / 2
    c = a // 2
    if (b - c).any():
        break
    else:
        a = b
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
As = [int(input()) for _ in range(N)]

sunuke = 0
while all([a % 2 == 0 for a in As]):
    sunuke += 1
    As = [a // 2 for a in As]
print(sunuke)

Submission status: Runtime Error

Solution code:
N = int(input())
As = [int(input()) for _ in range(N)]

sunuke = 0
while all([a % 2 == 0 for a in As]):
    sunuke += 1
    As = [a / 2 for a in As]
print(sunuke)

Submission status: Runtime Error

Solution code:
s = int(list(input()))
print(sum(s))

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
list = [a,b,c]
list.count("1")

Submission status: Runtime Error

Solution code:
x = str(input()).split(" ")

n = int(x[0])
a = int(x[1])
b = int(x[2])

plan1 = n*a
plan2 = b

if plan1 >= plan2:
	print(plan2)
else:
	print(plan1)

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
num = 0
while True:
    for i in n:
        if a[i] % 2 == 1:
          return ans
        else:
            a[i] = a[i] / 2
        num += 1

Submission status: Runtime Error

Solution code:
s=input()
num=0
if (s[0]==1):
  num++
if (s[1]==1):
  num++
if (s[2]==1):
  num++
print(num)

Submission status: Runtime Error

Solution code:
s = input()

count = 0

for i in (len(s)):
  if s[i] == '1':
    count = count + 1

print(count)

Submission status: Runtime Error

Solution code:
a,b,c =map(int,input().split())
s = a+b+c
print(s)

Submission status: Runtime Error

Solution code:
import numpy as np
def solve(N, K, A):
    numbers = {}
    for a in A:
        numbers[a] = numbers.get(a, 0) + 1
    M = len(numbers)
    if M <= K:
        return 0
    dp = np.full((M+1, M+1), N, dtype=int)
    dp[0,:] = 0
    for i, n in enumerate(numbers.values()):
        for j in range(M+1):
            if j > 0:
                dp[i+1,j] = min(dp[i+1,j], dp[i,j-1], dp[i,j] + n)
            else:
                dp[i+1,j] = min(dp[i+1,j], dp[i,j] + n)
    return min(dp[M,:K+1])

N, K = map(int, raw_input().split())
A = map(int, raw_input().split())
print solve(N, K, A)

Submission status: Runtime Error

Solution code:
s=input()
c=0
for i in range(s):
    if i=='1':
        c+=1
print(c)

Submission status: Runtime Error

Solution code:
import numpy as np
import pdb

'''
From first element, look through the sequence
until you encounter first element that is smaller than
its predecessor.

Take the difference, and find the minimum number that can
one can add to make the sequence appropriate.

I was shooting for
O(N**2), nut no, not with this.

This probably works only if all elements are positive...


There is much easier way to go.
One can make everything positive by adding max to all
the numbers,
and accumulate the entries.

However, why is this minimal...?  Well, there is no gurantee.
The problem is asking for 'one' solution with number of steps being less than
or equal to 2N. Oh No....
'''


def main():
    N = int(raw_input())
    As = np.array(raw_input().split(' ')).astype(int)
    procedure = process2(As)
    #As = test(As, procedure)
    printprocedure(procedure)


def process2(As):
    oldmaxAs = np.max(As)
    oldminAs = np.min(As)
    procedure = []


    #Uniformization
    if oldmaxAs > 0 and oldminAs < 0:
        if np.abs(oldmaxAs) < np.abs(oldminAs):
            helper = np.where(As == oldminAs)[0][0]
            for k in range(len(As)):
                procedure += [[helper, k]]
            maxAs = oldmaxAs + oldminAs
            minAs = oldminAs + oldminAs
        else:
            helper =  np.where(As == oldmaxAs)[0][0]
            for k in range(len(As)):
                procedure += [[helper, k]]
            maxAs = oldmaxAs + oldmaxAs
            minAs = oldminAs + oldmaxAs
    else:
        maxAs = oldmaxAs
        minAs = oldminAs

    pdb.set_trace()
    #After uniformization
    #negative mode
    if maxAs < 0:
        for k in range(0, len(As) - 1):
            procedure += [[len(As)-1-k, len(As)-1-k-1]]

    #positive mode
    if minAs >= 0:
        for k in range(1, len(As)):
            procedure += [[k-1, k]]

    return procedure


def test(As, procedure):
    for k in range(len(procedure)):
        As[procedure[k][1]] += As[procedure[k][0]]
    return As


def process(As):
    procedure = []
    for k in range(1, len(As)):
        delta = As[k] - As[k - 1]
        while(delta < 0):
            problematic = k
            require = -delta
            candidate = 0
            candidatevalue = -np.inf
            missing = require - As

            if np.min(missing) > 0:
                candidate = np.where(missing == np.min(missing))[0][0]
            else:
                for i in range(len(As)):
                    if missing[i] <= 0 and candidatevalue < missing[i]:
                        candidate = i
                        candidatevalue = missing[candidate]

            procedure += [[candidate, k]]
            As[k] = As[k] + As[candidate]
            delta = As[k] - As[k - 1]

    return procedure


def printprocedure(procedure):
    for k in range(len(procedure)):
        print '%s %s'%(procedure[k][0] +1 ,procedure[k][1] + 1)





if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
print({
  '000': 0,
  '001': 1,
  '010': 1,
  '011': 2,
  '100': 1,
  '101': 2,
  '110': 2,
  '111' 3
}[input()])

Submission status: Runtime Error

Solution code:
import math

N, K = map(int, input().split())
A = list(map(int, input().split()))

#keyはA[i]、valueは登場回数
A_unique = {}
 
for i in range(0,len(A)):
    if A[i] in A_unique:
        A_unique[A[i]] += 1
    else:
        A_unique[A[i]] = 1
v = list(A_unique.values())
v.sort() #登場回数が少ない順に書き換えていく
A_length = len(A_unique.keys()) #元々のAの長さ
d = 0

for k in v:
    if  A_length - d < K:
        print(d)
        break
    else:
        d += A_unique[k]

Submission status: Runtime Error

Solution code:
# A - Placing Marbles
# coding: utf-8

s1, s2 ,s3 = map(int, raw_input().split())
s = [s1, s2, s3]

print s.count(1)

Submission status: Runtime Error

Solution code:
def main():
    N = int(input())
    A = tuple(map(int, input().split()))
 
    a = list(A)
    m = 0
    xy = [] //ZeroMemory.Clear
    apnd = xy.append
    if min(a) == max(a):
        print(0)
        return
    elif min(a) < 0 and max(a) >= 0:
        if abs(min(a)) > max(a):
            x = min(a)
        else:
            x = max(a)
        idya = a.index(x)
        for i, j in enumerate(a):
            if j != x:
                a[i] += x
                m += 1
                apnd((idya + 1, i + 1))
 
    if min(a) >= 0:
        for i in range(N - 1):
            a[i+1] += a[i]
            m += 1
            apnd((i + 1, i + 2))
    elif max(a) < 0:
        for i in range(N - 1, 0, -1):
            a[i-1] += a[i]
            m += 1
            apnd((i + 1, i))
 
    print(m)
    for x, y in xy:
        print(x, y)
 
main()

Submission status: Runtime Error

Solution code:
N=input()
S=map(int,input().split())
sum=0
for num in S:
  sum=sum|num

for i in range(200):
  if sum>>i&1==1:
    print(i)
    break

Submission status: Runtime Error

Solution code:
import sys

a1 = sys.stdin.readline()
a2 = sys.stdin.readline()
a3 = sys.stdin.readline()
b1 = a1.rstrip()
b2 = a2.rstrip()
b3 = a3.rstrip()
s1 =int(b1)
s2 =int(b2)
s3 =int(b3)
print(s1+s2+s3)

Submission status: Runtime Error

Solution code:
n=int(input())
#print(n)                                                                                                     
#a=input().split()                                                                                            
a=[int(x) for x in input().split()]
#a=map(int,input().split())                                                                                   
#print(a)                                                                                                     
#print(a[0]+a[1])                                                                                             
count=0
while True:
    flag=0
#    print(a)                                                                                                 
    for i in range(n):
        if((a[i] % 2)==0):
#        if((a[i]!=1) and (a[i] % 2)==0):                                                                     
            flag+=0
            a[i]=a[i]/2
        else:
            flag+=1
#    print(flag)                                                                                              
    if(flag!=0):
        break
    else:
        count+=1
#        print(count)                                                                                         

print(count)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

a, b, c = map(int, raw_input().split())

print str(a+b+c)

Submission status: Runtime Error

Solution code:
a = list(input())
b = 0
for i in a:
    b += i

print(b)

Submission status: Runtime Error

Solution code:
s = input()
2. 
3.# sを分解して1の数をカウントする
4.print(s.count('1'))

Submission status: Runtime Error

Solution code:

1.# -*- coding: utf-8 -*-
2."""
3.Created on Wed Dec 20 11:35:39 2017
4. 
5.@author: kotania
6."""
7. 
8.s = input()
9. 
10.print(int(s[0])+int(s[1])+int(s[2]))

Submission status: Runtime Error

Solution code:
ggg

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <string>
using namespace std;


int main()
{
  string s;
  int c=0;
  
  cin >> s;
  for ( int i=0; i<s.length(); i++ ) {
    if ( s[i] == '1' ) c++;
  }
  cout << c << endl;
  
  return 0;
}

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 14 22:24:31 2017

@author: Kanoh
"""
import numpy as np
N = int(raw_input())#標準入力
A = raw_input()#標準入力
A_split=A.split(" ")
A_int=np.zeros((N))

for i in range(int(N)):
    A_int[i]=int(A_split[i])

counter=0
checker=0
while 1 :
    for i in range(N):
        if((A_int[i]%2)!=1) and((A_int[i])>1):
            A_int[i]=A_int[i]/2
        else:
            checker=1
    if(checker==1):
        break
    else:
        counter=counter+1
    
print counter

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 14 22:24:31 2017

@author: Kanoh
"""
import numpy as np
N = int(raw_input())#標準入力
A = raw_input()#標準入力
A_split=A.split(" ")
A_int=np.zeros((N))

for i in range(int(N)):
    A_int[i]=int(A_split[i])

counter=0
checker=0
while 1 :
    for i in range(N):
        if(A_int[i]%2)!=1:
            A_int[i]=A_int[i]/2
        else:
            checker=1
    if(checker==1):
        break
    else:
        counter=counter+1
    
print counter

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(raw_input())
# スペース区切りの整数の入力
b, c = map(int, raw_input().split())
# 文字列の入力
s = raw_input()
# 出力
print str(a+b+c) + " " + s

Submission status: Runtime Error

Solution code:
a = int(raw_input())
b, c = map(int, raw_input().split())
s = raw_input()
print str(a+b+c) + " " + s

Submission status: Runtime Error

Solution code:
n = input()
xs = input().split(' ')
xs = [int(x) for x in xs]
xs = set(xs)
xs = list(xs)
xs.sort()
a = [x for x in xs if x % 2 == 1]
if len(a) > 0:
    print(0)
else:
    m = 10 ** 9
    for x, y in zip(xs[:-1], xs[1:]):
        q = y - x
        if q < m:
            m = q
    if m > xs[0]:
        m = xs[0]
    count = 0
    while m % 2 == 0:
        count += 1
        m = m / 2
    print(count)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(raw_input())
# スペース区切りの整数の入力
b, c = map(int, raw_input().split())
# 文字列の入力
s = raw_input()
# 出力
print str(a+b+c) + " " + s

Submission status: Runtime Error

Solution code:
a = int(raw_input())
# スペース区切りの整数の入力
b, c = map(int, raw_input().split())
# 文字列の入力
s = raw_input()
# 出力
print str(a+b+c) + " " + s

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
array = np.array(list(map(int, input().split())))
c = 0
check = True
while check:
    for n in array:
        if n % 2 == 1:
            check = False

    array = array / 2
    c = c + 1
print(c-1)

Submission status: Runtime Error

Solution code:
import numpy as np
a = list(map(int,input().split()))
N = a[0]
K = a[1]
b = list(map(int,input().split()))
li = list(set(b))
c = np.array(b)
d = np.array([])
h = len(li) -K
Num = 0
if K >= len(li):
  print(0)
  exit()
for i in li :
  ind = np.take(c,np.where( c== i),axis = 0)
  d = np.append(d,ind.shape)
d = np.sort(d)
print(d)
for i in range(h):
  Num += d[i]
print(int(Num))

Submission status: Runtime Error

Solution code:
import numpy as np
N = list(input())
a = list(map(int,input().split()))

for i in range(1,30):
  b = np.array([n/2 if n%2==0 else 0 for n in a])
  a = b
  if 0 in list(b):
    print(i-1)
    exit()

Submission status: Runtime Error

Solution code:
l = list(input())
n=0
for int(i) in l :
  if int(i)==1:
    print(i)
    n += 1
print(n)

Submission status: Runtime Error

Solution code:
gmndiogjnaoe;

Submission status: Runtime Error

Solution code:
snuke=input()
num=0
for i in list(snuke):
  if i=='1':
    num++
print(str(num))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
b=1
count=0
for i in range(n):
    if(a[i]%2!=0):
        print(count)
        b=0
count=1
while b==1:
    for i in range(n):
        if(a[i]%2!=0):
            print(count)
            b=0
        a[i]/=2
    count+=1

Submission status: Runtime Error

Solution code:
# coding:utf-8
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
default_A = A.copy()
counted = list(map(lambda x:x*0, list(range(10))))

'''
counted2 = [[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7],[0,8],[0,9]]
for a in A:
    counted2[a-1][0] += 1
count2 = 0
for i in range(10):
    if counted2[i][0]>0:
        count2 += 1

iranai = count2-K
min_2 = 1<<15
min_number = []
for i in range(len(counted2)):
    for j in range(len(counted2)-1, i, -1):
        if counted2[j][0] < counted2[j-1][0]:
            counted2[j], counted2[j-1] = counted2[j-1], counted2[j]

for i in range(10):
    if counted2[0][0] == 0:
        counted2.pop(0)

last_min = 0
if iranai > 0:
    for i in range(iranai):
        last_min += counted2[i][0]
    print(last_min)
else:
    print(0)
'''


def BallCount(A):
    global counted
    for a in A:
        counted[a-1] += 1
    count = 0
    for i in range(10):
        if counted[i]>0:
            count+=1
    #print("count ",count, "A ", A)
    counted = [0,0,0,0,0,0,0,0,0,0]
    return count

#print(BallCount(A))
min_ = 1<<15
def func(reciveA):
    change_count = 0
    global default_A
    for i in range(N):
        #print("reciveA[i] ", reciveA[i] , "A[i] " ,default_A[i])
        if reciveA[i]!=default_A[i]:
            change_count += 1

        #print("change count", change_count)
    global min_
    min_ = min(min_, change_count)


def bfs(pos):
    ballcount = BallCount(A)

    if ballcount==K:
        #print("ballcount ",ballcount )
        func(A)
    if pos==N:
        return
    for i in default_A:
        A[pos] = i
        bfs(pos+1)
    
bfs(0)
if min_ == (1<<15):
    print(0)
else:
    print(min_)

Submission status: Runtime Error

Solution code:
n,k = [int(x) for x in input().split()]
s = {}

for i in input().split():
    if(i in s):
        s[i] += 1
    else:
        s[i] = 1


t = list(s.values())
t.sort()
a = 0

while len(t) > k:
    a += t.pop(0)

print(a)

Submission status: Runtime Error

Solution code:
N=int(input())
suji=input()
I1=suji.split(" ")
I=list(map(int,I1))
wari=2
n=0
kazu=0

while n<N:
    if n!=N-1:
        if I[n]%2==0:
            n+=1
    if  n==N-1:
        if I[N-1]%2==0:
            wari=wari*2
            kazu=kazu+1
            n=0
    else:
        X=0
        break
print(kazu)

Submission status: Runtime Error

Solution code:
# coding: utf-8

N = input()
array1 = input().split()
array = list(array1)
chk = 0

if (int(array[0])%2) != 0:
	print("0")
else:
	flg = 0
	mini1 = min(array)
	mini = int(mini1)
	while 1:
		if mini%2 != 0:
			break
		mini = mini/2
		flg +=1
		
		if mini == 0:
			break

	print(flg)

Submission status: Runtime Error

Solution code:
# coding: utf-8

N = input()
array1 = input().split()
#array2 = int(array1)
array = list(array1)
chk = 0

if (int(array[0])%2) != 0:
	print("0")
else:
	flg = 0
	mini1 = min(array)
	mini = int(mini1)
	while 1:
		mini = mini/2
		flg +=1
		if mini%2 !== 0:
			break

	print(flg)

Submission status: Runtime Error

Solution code:
#http://abc081.contest.atcoder.jp/
# -*- coding: utf-8 -*-

a,b,c = map(int,input().split())
print(a+b+c)

Submission status: Runtime Error

Solution code:
if __name__=="__main__":
        l1 = list(map(int,input().split(" ")))
        l2 = list(map(int,input().split(" ")))
        l = {i:0 for i in range(200001)}
        N = l1[0]
        K = l1[1]
        for i in range(N):
            l[l2[i]]+=1
        dict = sorted(l.values())
        condition = lambda t:t!=0
        fliter_dict = list(filter(condition,dict))
        if len(fliter_dict)<=K:
            print(0)
        else:
            print(sum(fliter_dict[0:(len(fliter_dict)-K)]))

Submission status: Runtime Error

Solution code:
import sys

input = sys.stdin.readline
print = sys.stdout.write

n,k = map(int,input().split())

freq = {}
a = [int(i) for i in input().split()]

for i in a:
    if i not in freq:
        freq[i] = 1
    else:
        freq[i] += 1

total = 0
while len(freq.keys()) > k:
    mn = (0,2000001)
    for i in freq.keys():
        if freq[i] < mn[1]:
            mn = (i,freq[i])
    total += mn[1]
    del freq[mn[0]]
print(str(total))

Submission status: Runtime Error

Solution code:
N = int(input())
A = [int(i) for i in input().split(' ')]
for i in range(10**9):
 if sum([i%2 for i in A])>0:
  print(i)
  break
 else: A = [i/2 for i in A]

Submission status: Runtime Error

Solution code:
N = int(input())
A = [int(i) for i in input().split(' ')]
for i in range(N):
 if sum([i%2 for i in A])>0:
  print(i)
  break
 else: A = [i//2 for i in A]

Submission status: Runtime Error

Solution code:
b = list(map(int, input().split()))
a = str(b)
ans = 0
if (a[1] == '1'):
    ans = ans+1
if (a[2] == '1'):
    ans = ans+1
if (a[3] == '1'):
    ans = ans+1
print(ans)

Submission status: Runtime Error

Solution code:
print(sum([int(x) for x in input().split()]))

Submission status: Runtime Error

Solution code:
t=raw_input().split(“”)
count=0
for i in t:
    if i == “1”:
        count+=1
print count

Submission status: Runtime Error

Solution code:
n = raw_input()
print(n.count("1"))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
N = int(sys.stdin.readline())
line = sys.stdin.readline()
A = [ int(i) for i in line.strip().split() ]
min = 999999
for a in A:
    cnt = 0
    while(min > cnt):
        if a%2 == 1:
            min = cnt
            break
        else:
            a = a/2
            cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
# coding: utf-8

N = input()
N_list = list(N)
N_len = len(N_list)
N_count = N_list("1")

if N_count ==0:
	print("0")
elif N_count == 1:
	print("1")
elif N_count == 2:
	print("2")
elif N_count == 3:
	print("3")

Submission status: Runtime Error

Solution code:
S = raw_input()
(S == '1').sum()

Submission status: Runtime Error

Solution code:
M = input()
lis =list(str(M))
count = 0
for item in lis:
  if item == ‘1’:
    count += 1
print (count)

Submission status: Runtime Error

Solution code:
a = list(map(int,input()))
print a.count("1")

Submission status: Runtime Error

Solution code:
a = int(input())
print a.count("1")

Submission status: Runtime Error

Solution code:
M = input()
lis =list(M)
count = 0
for item in lis:
  if item == ‘1’:
    count += 1
print (count)

Submission status: Runtime Error

Solution code:
a = int(input())
ans = 0
if a[0] == 1:
  ans = ans+1
else:
  ans = ans
if a[1] == 1:
  ans = ans+1
else:
  ans = ans
if a[2] == 1:
  ans = ans+1
else:
  ans = ans
print(ans)