Problem p03101 (python)

Fixed submission:
H, W = map(int, input().split())
h, w = map(int, input().split())

res = (H-h)*(W-w)

print(res)

Buggy submission (verdict: Runtime Error):
import numpy as np
def binary(_x):
    x = _x
    l = int(np.log2(x) + 1)
    res = [0] * l
    
    for i in range(l):
        res[i] += x%2
        x = int(x/2)
    return res


def a_xor(lis, i, sub, sub_max):
    return lis[i] * ( ( sub_max - sub + 1 ) % 2 )


def b_xor(lis, i, sub, sub_max):
    return lis[i] * ( ( sub_max - sub ) % 2 )


def main():
    A, B = map(int, input().split())
    bin_a = binary(A)
    bin_b = binary(B)
    odd_even_vec = [0] * len(bin_b)

    #print("a")
    sub = 0
    sub_max = 0
    for i, bit in enumerate(bin_a):
        if i == 0:
            odd_even_vec[i] += bit%2
        else:
            k = i-1
            sub += bit * 2**k
            sub_max += 2**k
            odd_even_vec[i] += a_xor(bin_a, i, sub, sub_max)
        #print(odd_even_vec, sub, sub_max)

    #print("b")
    sub = 0
    sub_max = 0
    for i, bit in enumerate(bin_b):
        if i == 0:
            odd_even_vec[i] += bit%2
        else:
            k = i-1
            sub += bit * 2**k
            sub_max += 2**k
            odd_even_vec[i] += b_xor(bin_b, i, sub, sub_max)
            
        #print(odd_even_vec, sub, sub_max)
        
    res = 0
    for i, bit in enumerate(odd_even_vec):
        res += bit%2 * 2**i

    print (res)

    
main()

Buggy submission (verdict: Runtime Error):
import numpy as np

def main():
    N, M = map(int, input().split())

    AB= np.array([list(map(int, list(input().split()))) for _ in range(N)])
    print(AB)
    
    AB_sort_by_A = np.sort(AB.view('i8,i8'), order=['f0'], axis=0).view(np.int)

    print(AB_sort_by_A)
    buyNum = 0
    money = 0
    for i in range(N):
        if buyNum >= M:
            break
        else:
            drinkVal, drinkNum = AB_sort_by_A[i]
            if M - buyNum > drinkNum:
                buyNum += drinkNum
                money += drinkVal * drinkNum
            else:
                money += drinkVal * (M-buyNum)
                break
    print(money)
        
            
    

    
    
    
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np

def getInt():
  return map(int, input().split())

N, M, C = getInt()
B = list(getInt())
ans = 0
for i in range(N):
  A = list(getInt())
  if sum(a*b for a,b in zip(A,B)) + C > 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

def getInt():
  return map(int, input().split())

N, M, C = getInt()
B = list(getInt())
ans = 0
for i in range(N):
  A = list(getInt())
  if sum(a*b for a,b in zip(A,B)) + C > 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

def getInt():
  return map(int, input().split())

N, M, C = getInt()
B = list(getInt())
ans = 0
for i in range(N):
  A = list(getInt())
  if sum([a*b for a,b in zip(A,B)]) + C > 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

def getInt():
  return map(int, input().split())

N, M, C = getInt()
B = list(getInt())
ans = 0
for i in range(N):
  A = list(getInt())
  if sum([a*b for (a,b) in (A,B)]) + C > 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

def main():
    """
    N, M, C = np.array([int(x) for x in input().split(' ')])
    b_arr = np.array([int(x) for x in input().split(' ')])
    a_mat = np.zeros((N,M))
    """
    N ,M, C = map(int, input().split())
    b_arr = np.array(list(map(int, input().split())))
    a_mat = np.array( [ list(map(int, input().split())) for i in range(N) ] )
    
   # for i in range(N):
    #    a_mat[i] = np.array(list(map(int, input().split())))
        #a_mat[i] = np.array([int(x) for x in input().split(' ')])

        #print ( len(list( np.where( a_mat.dot(b_arr)> -C ) )[0]) )
    print ( np.array(np.where(a_mat.dot(b_arr) > -C)).shape[1] )

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np

def main():
    """
    N, M, C = np.array([int(x) for x in input().split(' ')])
    b_arr = np.array([int(x) for x in input().split(' ')])
    a_mat = np.zeros((N,M))
    """
    N ,M, C = list(map(int, input().split()))
    b_arr = np.array(list(map(int, input().split())))
    a_mat = np.zeros((N,M))
    
    for i in range(N):
        a_mat[i] = np.array(list(map(int, input().split())))
        #a_mat[i] = np.array([int(x) for x in input().split(' ')])

        #print ( len(list( np.where( a_mat.dot(b_arr)> -C ) )[0]) )
    print ( np.array(np.where(a_mat.dot(b_arr) > -C)).shape[1] )

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np

def main():
    N, M, C = np.array([int(x) for x in input().split(' ')])
    b_arr = np.array([int(x) for x in input().split(' ')])
    a_mat = np.zeros((N,M))

    for i in range(N):
        a_mat[i] = np.array([int(x) for x in input().split(' ')])

    #print ( len(list( np.where( a_mat.dot(b_arr)> -C ) )[0]) )        
    print ( np.array(np.where(a_mat.dot(b_arr) > -C)).shape[1] )

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np

def main():
    N, M, C = np.array([int(x) for x in input().split(' ')])
    b_arr = np.array([int(x) for x in input().split(' ')])
    a_mat = np.zeros((N,M))

    for i in range(N):
        a_mat[i] = np.array([int(x) for x in input().split(' ')])

    print ( len(list( np.where( a_mat.dot(b_arr)> -C ) )[0]) )

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np

def main():
    N, M, C = np.array([int(x) for x in input().split(' ')])
    b_arr = np.array([int(x) for x in input().split(' ')])
    a_mat = np.zeros((N,M))

    for i in range(N):
        a_mat[i] = np.array([int(x) for x in input.split(' ')])

    print ( len(list( np.where( a_mat.dot(b_arr)> -C ) )[0]) )

if __name__ == '__main__':
    main()