Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03165 (python)

Fixed submission:
s = input()
t = input()

dp = [[0] * (len(t) + 1) for _ in range(len(s) + 1)]

for i in range(1, len(s) + 1):
    for j in range(1, len(t) + 1):
        char = s[i-1]
        if char == t[j-1]:
            dp[i][j] = dp[i-1][j-1] + 1
        else:
            dp[i][j] = max(dp[i-1][j], dp[i][j-1])

answer = ''
i, j = len(s), len(t)
now = dp[i][j]
while i > 0 and j > 0:
    if dp[i-1][j] == now:
        i -= 1
        continue
    if dp[i][j-1] == now:
        j -= 1
        continue
    answer += s[i-1]
    i -= 1
    j -= 1
    now -= 1

print(answer[::-1])

Buggy submission (verdict: Runtime Error):
import numpy as np
s = input()
t = input()

dp = np.zeros((len(s) + 1, len(t) + 1))

for i in range(1, len(s) + 1):
    for j in range(1, len(t) + 1):
        char = s[i-1]
        if char == t[j-1]:
            dp[i, j] = dp[i-1, j-1] + 1
        else:
            dp[i, j] = max(dp[i-1, j], dp[i, j-1])

answer = ''
i, j = len(s), len(t)
now = dp[i, j]
while i > 0 and j > 0:
    if dp[i-1, j] == now:
        i -= 1
        continue
    if dp[i, j-1] == now:
        j -= 1
        continue
    answer += s[i-1]
    i -= 1
    j -= 1
    now -= 1

print(answer[::-1])
Problem p02639 (python)

Fixed submission:
print(input().split().index("0") + 1)

Buggy submission (verdict: Runtime Error):
import sys
print(sys.split().index("0") + 1)

Buggy submission (verdict: Runtime Error):
import sys
print( sys.stdin.split().indx("0"))

Buggy submission (verdict: Runtime Error):
print( sys.stdin.split().indx("0"))
Problem p02909 (python)

Fixed submission:
S = input()

if S == "Sunny":
    print("Cloudy")
elif S == "Cloudy":
    print("Rainy")
else:
    print("Sunny")

Buggy submission (verdict: Runtime Error):
import math

nm = list(map(int,input().split(" ")))
N = nm[0]
M = nm[1]

A = list(map(int,input().split(" ")))
A.sort(reverse=True)
hmax = math.floor(A[0]/2)
index = 0
while M > 0:
    if index != len(A):
        if A[index] >= hmax:
            A[index] = math.floor(A[index]/2)
            M = M -1
            index = index + 1
        else:
            index = 0
            A.sort(reverse=True)
            hmax = math.floor(A[0])
    else:
        index = 0
    if hmax == 0:
        break
print(sum(A))
Problem p02639 (python)

Fixed submission:
import sys
# from collections import deque
# from collections import Counter
# from math import sqrt
# from math import log
# from math import ceil

# def gcd(a, b):
# 	if(a==0):
# 		return b 
# 	return gcd(b%a,a)

# def sieve(n): 
# 	prime=[True for i in range(n+1)]
# 	p=2
# 	while(p*p<=n): 
# 		if (prime[p]==True): 
# 			for i in range(p*p,n+1,p): 
# 				prime[i]=False
# 		p+=1
# 	prime[0]=False
# 	prime[1]=False
# 	s=set()
# 	for i in range(len(prime)):
# 		if(prime[i]):
# 		s.add(i)
# 	return s 

# alpha=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
# mod=10**9+7

fast_reader=sys.stdin.readline
fast_writer=sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i)) for i in argv))
	fast_writer('\n')

def list_input():
	return list(map(int, input().split()))

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

#_______________________________________________________________________________________________________________________________________

l=list_input()
print(15-sum(l))

Buggy submission (verdict: Runtime Error):
import sys
# from collections import deque
# from collections import Counter
# from math import sqrt
# from math import log
# from math import ceil

# def gcd(a, b):
# 	if(a==0):
# 		return b 
# 	return gcd(b%a,a)

# def sieve(n): 
# 	prime=[True for i in range(n+1)]
# 	p=2
# 	while(p*p<=n): 
# 		if (prime[p]==True): 
# 			for i in range(p*p,n+1,p): 
# 				prime[i]=False
# 		p+=1
# 	prime[0]=False
# 	prime[1]=False
# 	s=set()
# 	for i in range(len(prime)):
# 		if(prime[i]):
# 		s.add(i)
# 	return s 

# alpha=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
# mod=10**9+7

fast_reader=sys.stdin.readline
fast_writer=sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i)) for i in argv))
	fast_writer('\n')

def list_input():
	return list(map(int, input().split()))

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

#_______________________________________________________________________________________________________________________________________

x,n=sep_input()
l=list_input()
s=set(l)
i=0
while(True):
	if(x-i not in s):
		print(x-i)
		break
	elif(x+i not in s):
		print(x+i)
		break
	else:
		i+=1
Problem p02639 (python)

Fixed submission:
li = [i for i in map(int, input().split())]

print(li.index(0)+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
leng = 10**6+1
memo = [0]*leng
li = []
for n in map(int, input().split()):
    x = 0
    li.append(n)
    while x < leng:
        memo[x] +=1
        x += n
count = 0
for n in li:
    if memo[n] == 1:
        count+=1
print(count)
Problem p02678 (python)

Fixed submission:
from collections import deque
dic = {}
def make_map(a, b, dic):
    if a in dic.keys():
        dic[a].append(b)
    else:
        dic[a] = [b]
N, M = map(int, input().split())
for m in range(M):
    a, b = map(int, input().split())
    make_map(a-1, b-1, dic)
    make_map(b-1, a-1, dic)
queue = deque([0])
count = 0
dekai = 10**5
lenlist = [dekai]*N
lenlist[0] = 0
while queue:
    a = queue.popleft()
    for i in dic[a]:
        if lenlist[i] ==dekai or a == 0:
            queue.append(i)#今までいったことないなら見るリストに追加
            lenlist[i] = a #今いる座標の距離+!が次の座標の距離
print("Yes")
for n in range(1,N, 1):
    print(lenlist[n]+1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
dic = {}
def make_map(a, b, dic):
    if a in dic.keys():
        dic[a].append(b)
    else:
        dic[a] = [b]
for m in range(M):
    a, b = map(int, input().split())
    make_map(a-1, b-1, dic)
    make_map(b-1, a-1, dic)
maplist = [0]*(N)
minlist = [10**5]*N
logs = []
def dfs(point, depth, log):
    if str(point) in log:
        logs.append(log)
        return
    if minlist[point] >= depth:
        minlist[point] = depth
        if len(log) >= 1:
            maplist[point] = int(log[-1])+1
    log+=str(point)
    depth+=1
    for p in dic[point]:
        dfs(p,depth,  log)
dfs(0,0, "")
if 0 in maplist[1:]:
    print("No")
else:
    print("Yes")
    for i in range(N-1):
        print(maplist[i+1])
Problem p02684 (python)

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
passlist = [0]*N
point = 1
depth = 0
waylist = []
while passlist[point-1] == 0:
    waylist.append(point)
    passlist[point-1] = depth
    point = A[point-1]
    depth+=1
roop = waylist[waylist.index(point):len(waylist)]
firstreach = passlist[roop[0]-1]
if K < firstreach:
  print(passlist.index(K)+1)
else:
  print(roop[(K-firstreach)%len(roop)])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
passlist = [0]*N
point = 1
depth = 0
waylist = []
while passlist[point-1] == 0:
    passlist[point-1] = 1
    point = A[point-1]
    waylist.append(point)
    depth+=1
print(waylist[depth-K%depth])
Problem p02713 (python)

Fixed submission:
import math
k = int(input())
count=0
for p in range(1,k+1):
    for q in range(p,k+1):
        for r in range(q,k+1):
            if p == q == r:
                count+=math.gcd(math.gcd(p,q), r)
            elif p == q:
                count+=math.gcd(math.gcd(p,q), r)*3
            elif q == r:
                count+=math.gcd(math.gcd(p,q), r)*3
            elif p == r:
                count+=math.gcd(math.gcd(p,q), r)*3
            else:
                count+=math.gcd(math.gcd(p,q), r)*6
print(count)

Buggy submission (verdict: Runtime Error):
import math
count=0
for p in range(1,k+1):
    for q in range(1,k+1):
        for r in range(1,k+1):
            count+=math.gcd(math.gcd(p,q), r)
            
print(count)
Problem p02717 (python)

Fixed submission:
X, Y, Z = map(int, input().split())
print("{} {} {}".format(Z,X,Y))

Buggy submission (verdict: Runtime Error):
N, K, C = map(int, input().split())
S = list(input())
#left_greedy
countr = 0
countl = 0
switchr = 0
switchl = 0
left_greedy = [0]*len(S)
right_greedy=[0]*len(S)
#left
for l in range(len(S)):
    i = S[l]
    if switchl ==1:
        if i == 'o':
            if countl >= C:
                left_greedy[l]=1
                clist[l] = countl
                countl = 0
            else:
                countl+=1
                clist[l] = countl
        else:
            countl+=1
    else:
        if i == 'o':
            left_greedy[l]=1
            switchl+=1
#right_greedy
    r = len(S)-l-1
    i = S[r]
    if switchr ==1:
        if i == 'o':
            if countr >= C:
                right_greedy[r]=1
                
                countr = 0
            else:
                countr+=1
        else:
            countr+=1
            
    else:
        if i == 'o':
            right_greedy[r]=1
            switchr+=1
for n in range(len(S)):
    if left_greedy[n] == right_greedy[n]==1:
        print(n+1)

Buggy submission (verdict: Runtime Error):
N, K, C = map(int, input().split())
S = list(input())
countr = 0
countl = 0
switchr = 0
switchl = 0
left_greedy = [0]*len(S)
right_greedy=[0]*len(S)
#left
for l in range(len(S)):
    i = S[l]
    if switchl ==1:
        if i == 'o':
            if countl >= C:
                left_greedy[l]=1
                clist[l] = countl
                countl = 0
            else:
                countl+=1
                clist[l] = countl
        else:
            countl+=1
    else:
        if i == 'o':
            left_greedy[l]=1
            switchl+=1
#right_greedy
    r = len(S)-l-1
    i = S[r]
    if switchr ==1:
        if i == 'o':
            if countr >= C:
                right_greedy[r]=1
                
                countr = 0
            else:
                countr+=1
        else:
            countr+=1
            
    else:
        if i == 'o':
            right_greedy[r]=1
            switchr+=1
for i in range(len(S)):
    if S[i] ==  'o':
        l = left_greedy[0:i].count(1)
        r = right_greedy[i+1:len(S)].count(1)
        x = r+l
        if 1 in left_greedy[0:i][::-1]:
            if 1 in right_greedy[i+1:len(S)-1]:
                if left_greedy[0:i][::-1].index(1)+right_greedy[i+1:len(S)-1][::-1].index(1)+1 < C:
                    x+=-1
        if x < K:
            print(i+1)
Problem p02732 (python)

Fixed submission:
import collections
n = int(input())
a = map(int, input().split())
li = []
for i in a:
    li.append(i)
collections.Counter(li)
m = 0
dic = collections.Counter(li)
for i in dic.values():
    m += int(i*(i-1)*0.5)
for k in range(n):
      print(m-dic[li[k]]+1)

Buggy submission (verdict: Runtime Error):
import itertools
h, w, k = map(int, input().split())
li_hw =  [list(f) for f in [input() for _ in range(h)]]
all_h = []
score = []
# for l in range(2**(h-1)):
#     ind = []
#     pre = 0
#     cut_list=[]
#     hline_num = 0
#     for n,yn in enumerate(reversed(list(bin(l))[2:])):
#         if yn == "1":
#             cut_list.append(li_hw[pre:n+1])
#             pre = n+1
#     cut_list.append(li_hw[pre:h])
for i in itertools.product([0, 1], repeat=h-1):
    cut_list=[]
    hline_num = 0
    pre = 0
    cut_list = []
    for n, i2 in enumerate(i):
        if i2 == 1:
            cut_list.append(li_hw[pre:n+1])
            pre = n+1
    cut_list.append(li_hw[pre:h])
    hline_num = i.count(1)
    pred = 0
    wline_num = 0
    #print("list is {}".format(cut_list))
    
    
    for y in range(w):
        wcounter_list = []
        for c in cut_list:
            wcounter = 0
            for c2 in c:
                wcounter += c2[pred:y+1].count("1")
            wcounter_list.append(wcounter)
        #print("wcounter{}".format(wcounter_list))
        if max(wcounter_list) > k:
            pred = y
            wline_num += 1
            #print("line between{}and{}".format(y-1, y))
    #print("wline{}, hline{}".format(wline_num, hline_num))
    score.append(wline_num+hline_num)
print(min(score))
Problem p02761 (python)

Fixed submission:
n, m = map(int, input().split())
sc = {}
for m2 in range(m):
    sc[m2]=input().split()
ok_list= []
for al in range(0, 10**(n)):
    ynli = []
    li = list(str(al))
    if len(li) == n:
        for mm in range(m):
            if li[int(sc[int(mm)][0])-1] != sc[int(mm)][1]:
                ynli.append("NO")
        if "NO" in ynli:
            pass
        else:
            ok_list.append(al)
    else:
        pass
if ok_list == []:
    print(-1)
else:
    print(min(ok_list))

Buggy submission (verdict: Runtime Error):
ok_list= []
for al in range(10**(n-1), 10**(n)):
    ynli = []
    li = list(str(al))
    for mm in range(m):
        if li[int(sc[int(mm)][0])-1] != sc[int(mm)][1]:
            ynli.append("NO")
    if "NO" in ynli:
        pass
    else:
        ok_list.append(al)
if ok_list == []:
    print(-1)
print(min(ok_list))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
sc = {}
for m2 in range(m):
    sc[m2]=input().split()
ok_list= []
ok_list= []
for al in range(10**(n-1), 10**(n)):
    ynli = []
    li = list(str(al))
    for mm in range(m):
        if li[int(sc[int(mm)][0])-1] != sc[int(mm)][1]:
            ynli.append("NO")
    if "NO" in ynli:
        pass
    else:
        ok_list.append(al)
print(min(ok_list))
Problem p02995 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
def div_num(a, b, c):
    if (a%c)==0:
        return (b//c)-(a//c)+1
    else:
        return (b//c)-(a//c)
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
XC = div_num(A, B, C)
XD = div_num(A, B, D)
XCD = div_num(A,B,int((C*D)/gcd(C,D)))
print(B-A+1-(XC+XD-XCD))

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
def div_num(a, b, c):
    if (a%c)==0:
        return (b//c)-(a//c)+1
    else:
        return (b//c)-(a//c)
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
XC = div_num(A, B, C)
XD = div_num(A, B, D)
print("XC==={},  XD==={},  XCD==={}".format(XC,XD,XCD))
print(B-A+1-(XC+XD-XCD))

Buggy submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())
def div_num(a, b, c):
    if (a%c)==0:
        return (b//c)-(a//c)+1
    else:
        return (b//c)-(a//c)

XC = div_num(A, B, C)
XD = div_num(A, B, D)
XCD = div_num(A,B,int((C*D)/math.gcd(C,D)))
print(B-A+1-(XC+XD-XCD))
Problem p03161 (python)

Fixed submission:
N, K = map(int, input().split())
h = [i for i in map(int, input().split())]
memo = [0]*N
for i in range(N):
    mini = 10**10
    for j in range(i-min(i, K), i, 1):
        if memo[j] + abs(h[i]-h[j]) < mini:
            mini = memo[j] + abs(h[i]-h[j])
    if i != 0:
        memo[i] = mini
print(memo[N-1])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [i for i in map(int, input().split())]
memo = [0]*N
for i in range(N):
    mini = 10**10
    for j in range(i-min(i, K), i, 1):
        if memo[j] + abs(h[i]-h[j]) < mini:
            mini = memo[j] + abs(h[i]-h[j])
    if i != 0:
        memo[i] = mini
print(memo[N-1])
N, K = map(int, input().split())
h = [i for i in map(int, input().split())]
memo = [0]*N
for i in range(N):
    mini = 10**10
    for j in range(i-min(i, K), i, 1):
        if memo[j] + abs(h[i]-h[j]) < mini:
            mini = memo[j] + abs(h[i]-h[j])
    if i != 0:
        memo[i] = mini
print(memo[N-1])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [i for i in map(int, input().split())]
memo = [0]*N
for i in range(N):
    mini = 10**10
    for j in range(i-min(i, K), i, 1):
        if memo[j] + abs(h[i]-h[j]) < mini:
            mini = memo[j] + abs(h[i]-h[j])
    if i != 0:
        memo[i] = mini
print(memo[N-1])
N, K = map(int, input().split())
h = [i for i in map(int, input().split())]
memo = [0]*N
for i in range(N):
    mini = 10**10
    for j in range(i-min(i, K), i, 1):
        if memo[j] + abs(h[i]-h[j]) < mini:
            mini = memo[j] + abs(h[i]-h[j])
    if i != 0:
        memo[i] = mini
print(memo[N-1])
提出情報
Problem p03164 (python)

Fixed submission:
import numpy
N, W = map(int, input().split())
memo = numpy.array([[10**9+1 for i in range(10**5+1)] for j in range(N)])
memo[-1][0] = 0
for n in range(N):
    w, v = map(int, input().split())
    memo[n][:v] = memo[n-1][:v]
    memo[n][v:] = numpy.fmin(memo[n-1][v:], memo[n-1][:-v]+w)
a = numpy.where(memo[-1] <= W)
print(numpy.max(a[0]))

Buggy submission (verdict: Runtime Error):
import numpy as np
N, W = map(int, input().split())
dp = np.zeros((N, W+1), dtype = "int64")
for i in range(N):
    w, v = map(int, input().split())
    dp[i,-w:] = dp[i-1, -w:] #残りの重さW-w以上にするためには、荷物を入れられない。
    dp[i, :W-w+1] = np.fmax(dp[i-1, :W-w+1], dp[i-1, w:]+v)
print(dp[N-1, 0])

Buggy submission (verdict: Runtime Error):
import numpy as np
N, W = map(int, input().split())
dp = np.zeros((N, W+1), dtype = "int64")
for i in range(N):
    w, v = map(int, input().split())
    dp[i,-w:] = dp[i-1, -w:] #残りの重さW-w以上にするためには、荷物を入れられない。
    dp[i, :W-w+1] = np.fmax(dp[i-1, :W-w+1], dp[i-1, w:]+v)
print(dp[N-1, 0])
Problem p03844 (python)

Fixed submission:
a,s,b = map(str, input().split())
if s == "+":
    print(int(a) + int(b))
else:
    print(int(a) - int(b))

Buggy submission (verdict: Runtime Error):
a,s,b = input(str, input().split())
if s == "+":
    print(int(a) + int(b))
else:
    print(int(a) - int(b))

Buggy submission (verdict: Runtime Error):
a,s,b = input(str, input.split())
if s ="+":
    print(int(a) +int(b))
else:
    print(int(a) - int(b))

Buggy submission (verdict: Runtime Error):
a,s,b = input(str, input.split())
if s == "+":
    print(a + b)
else:
    print(a - b)

Buggy submission (verdict: Runtime Error):
a,s,b = input(str, input.split())
if s ="+":
    print(a + b)
else:
    print(a - b)
Problem p02639 (python)

Fixed submission:
list1 = list(map(int, input().split()))


for i in range(1,6):
  if list1[i-1] != i:
    print(i)

Buggy submission (verdict: Runtime Error):
N=input()
A = list(map(int, input().split()))
T=True
sucl =[]
for i in range(0,int(N)):
  T=True
  for j in range(0,int(N)):
    
    if A[i] % A[j]==0:
      if i==j:
        pass
      else:
        T=False
        break
        
  if T==True:
    sucl.append(i)
print(len(sucl))

Buggy submission (verdict: Runtime Error):
X, N = map(int,input().split())
plist = list(map(int, input().split()))
if len(plist)==0:
  print(X)
  break
abst1 = []
abst2 = []
suci = []
for i in range(1,101):
  if i in plist:
    pass
  else:
    abst1.append(abs(X-i))
    abst2.append([i,abs(X-i)])
A = min(abst1)
for j in range(0,len(abst1)):
  if abst2[j][1] == A:
    print(abst2[j][0])
    break

Buggy submission (verdict: Runtime Error):
list1 = list(map(int, input().split()))


for i in range(1,5):
  if list1[i-1] != i:
    return(i)

Buggy submission (verdict: Runtime Error):
list = []
list.append(input())



for i in range(1,5):
  if list[i-1] != i:
    return(i)
Problem p02640 (python)

Fixed submission:
X,Y = map(int,input().split())
T = False
for i in range(0,X+1):
  p = X-i
  J= 2*i + 4*p
  if J ==Y:
    T = True
if T == True:
  print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
X = input()
Y = input()
T = false
for i in range(1,X+1):
  p = X-i
  J= 2*i + 4*p
  if J =Y:
    T = true
if T == true:
  print("Yes")
  else print("No")
Problem p02642 (python)

Fixed submission:
N = input()
A = list(map(int, input().split()))
N = int(N)
MA = max(A)
s=0
LS = [0 for i in range(0,MA)]
for i in range(0,N):
  k=1
  while A[i]*k<=MA:
    LS[A[i]*k-1] +=1
    k +=1
for j in range(0,N):
  if LS[A[j]-1]==1:
    s+=1
print(s)

Buggy submission (verdict: Runtime Error):
sucl =[]
for i in range(0,int(N)):
  T=True
  for j in range(0,int(N)):
    if T== False:
      break
    if A[i]<A[j]:
      break
    if A[i] % A[j]==0:
      if i==j:
        pass
      else:
        T=False
        
  if T==True:
    sucl.append(i)
print(len(sucl))
Problem p02640 (python)

Fixed submission:
import math
x, y = map(int, input().split())
a = (4 * x - y) / 2
if a >= 0 and a <= x and a == math.ceil(a):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
pyenv shell 3.8.0
dyld: Library not loaded: /usr/local/opt/libevent/lib/libevent-2.1.6.dylib
  Referenced from: /usr/local/bin/tmux
  Reason: image not found
[2]    51266 abort      tmux
% pyenv shell 3.8.0                                                   ~/Documents/sub-programming/atcoder
pyenv: shell integration not enabled. Run `pyenv init' for instructions.
% python 170a.py                                                      ~/Documents/sub-programming/atcoder
0 2 3 4 5
Traceback (most recent call last):
  File "170a.py", line 3, in <module>
    if h[i] == 0:
IndexError: list index out of range
% python 170a.py                                                      ~/Documents/sub-programming/atcoder
0 2 3 4 5
1
% python                                                              ~/Documents/sub-programming/atcoder
Python 3.8.0 (default, Dec  6 2019, 13:22:27) 
[Clang 8.0.0 (tags/RELEASE_800/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> int(2,1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: int() base must be >= 2 and <= 36, or 0
>>> int(2.1)
2
>>> int(2.4)
2
>>> type(2.1)
<class 'float'>
>>> math.ceil(2.1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'math' is not defined
>>> 1.ceil()
  File "<stdin>", line 1
    1.ceil()
      ^
SyntaxError: invalid syntax
>>> 
KeyboardInterrupt
>>> eix
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'eix' is not defined
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> 
% python 170b.py                                                      ~/Documents/sub-programming/atcoder
  File "170b.py", line 5
    print('Yes'):
                ^
SyntaxError: invalid syntax
% python 170b.py                                                      ~/Documents/sub-programming/atcoder
3 8
Yes
%                                                                     ~/Documents/sub-programming/atcoder
Problem p02837 (python)

Fixed submission:
n = int(input())
a = [0 for _ in range(n)]
xy = [[] for _ in range(n)]
for i in range(n):
  a[i] = int(input())
  for j in range(a[i]):
    xy[i].append(list(map(int, input().split())))
#print(xy)

for i in range(2**n-1, -1, -1):
  #print('0%db' % n)
  num = format(i, '0%db' % n)
  #print(num)
  flag = False
  for j in range(n):
    #print(num[j])
    if int(num[j]) == 1:
      for k in range(a[j]):
        #print(xy[j][k])
        if int(num[xy[j][k][0]-1]) != xy[j][k][1]:
          flag = True
          break
      if flag:
        break
  if not flag:
    cnt = 0
    for l in range(n):
      if int(num[l]):
        cnt += 1
    break
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [0 for _ in range(n)]
xy = [[] for _ in range(n)]
for i in range(n):
  a[i] = int(input())
  for j in range(a[i]):
    xy[i].append(list(map(int, input().split())))
#print(xy)

for i in range(2**n-1, -1, -1):
  num = format(i, '03b')
  #print(num)
  flag = False
  for j in range(n):
    #print(num[j])
    if int(num[j]) == 1:
      for k in range(a[j]):
        #print(xy[j][k])
        if int(num[xy[j][k][0]-1]) != xy[j][k][1]:
          flag = True
          break
      if flag:
        break
  if not flag:
    cnt = 0
    for l in range(n):
      if int(num[l]):
        cnt += 1
    break
print(cnt)
Problem p02909 (python)

Fixed submission:
wea = input()
if wea == "Sunny":
    print("Cloudy")
elif wea == "Cloudy":
    print("Rainy")
else:
    print("Sunny")

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

s = input().split()
N = int(s[0])
M = int(s[1])
A = np.array(list(map(int, input().split())))
for i in range(M):
    A[A.argmax()] //= 2
print(np.sum(A))