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

Fixed submission:
# C - Vacation
N = int(input())
A = []
for _ in range(N):
    a,b,c = map(int,input().split())
    A.append((a,b,c))
    
# 無限大の値
INF = 10**10

# DP テーブル (値と前に選んだ活動を保持)
# a (j = 0), b (j = 1), c (j = 2)に記録
dp = [[0]*3 for _ in range(100010)]

# DP テーブル全体を初期化
for i in range(100010):
    for j in range(3):
        dp[i][j] = -INF# 最大化問題
        
# 初期条件
dp[0][0],dp[0][1],dp[0][2] = 0,0,0
        
# v 日目以前に (v 日目以前の幸福度最大値を求める)
for v in range(1,N+1):
    # v-1 日目の活動
    for w in range(3):
        # v 日目の活動
        for k in range(3):
            # 前日と活動が同じならスルー
            if w == k:
                continue
            # v 日目の情報は A[v-1] であることに注意
            dp[v][k] = max(dp[v][k], dp[v-1][w] + A[v-1][k])

# N 日目以前の幸福度最大値を出力
ans = max(dp[N])            
print(ans)

Buggy submission (verdict: Runtime Error):
# C - Vacation AC
import sys
sys.setrecursionlimit(10**6)
N = int(input())
A = []
for _ in range(N):
    a,b,c = map(int,input().split())
    A.append((a,b,c))

# 無限大の値
INF = 10**10

# DP テーブル
dp = [[0]*3 for _ in range(100010)]

# DP テーブル全体を初期化
for i in range(5):
    for j in range(3):
        dp[i][j] = 0# 最大化問題

def rec(v):
    # v-1 日目の活動 (本当は v)
    for w in range(100010):
        print(v,w)
        if dp[v][w] > 0:
       
            return dp[v]
        if v == 0:
            dp[v][w] = 0
         
            return dp[v]
        res = 0
        # v 日目の活動 (本当は v-1)
        for k in range(3):
            if w == k:
               
                continue
            res = max(res,rec(v-1)[k] + A[v-1][w]) # v-1日の活動のところに記録している？
            dp[v][w] = res # ここで kを記録しているのに w を呼び出していた
            print(v,w,k,dp[v])
    return dp[v]

rec(N)
ans = max(dp[N])
print(ans)
# w がずっと 0
# w と k の扱いが逆

Buggy submission (verdict: Runtime Error):
# C - Vacation AC
N = int(input())
A = []
for _ in range(N):
    a,b,c = map(int,input().split())
    A.append((a,b,c))

# 無限大の値
INF = 10**10

# DP テーブル
dp = [[0]*3 for _ in range(5)]

# DP テーブル全体を初期化
for i in range(5):
    for j in range(3):
        dp[i][j] = 0# 最大化問題

def rec(v):
    # v-1 日目の活動 (本当は v)
    for w in range(3):
        print(v,w)
        if dp[v][w] > 0:
       
            return dp[v]
        if v == 0:
            dp[v][w] = 0
         
            return dp[v]
        res = 0
        # v 日目の活動 (本当は v-1)
        for k in range(3):
            if w == k:
               
                continue
            res = max(res,rec(v-1)[k] + A[v-1][w]) # v-1日の活動のところに記録している？
            dp[v][w] = res # ここで kを記録しているのに w を呼び出していた
            print(v,w,k,dp[v])
    return dp[v]

rec(N)
ans = max(dp[N])
print(ans)
# w がずっと 0
# w と k の扱いが逆
Problem p03163 (python)

Fixed submission:
# D - Knapsack 1
N,W = map(int,input().split())
value = []
weight = []
for _ in range(N):
    w,v = map(int,input().split())
    value.append(v)
    weight.append(w)

# DP テーブル
# dp[i][j]: i-1 番目までの品物から重さが j を超えないように選んだときの価値の最大値
# W <= 100000, N <= 100 よりテーブルの個数を決める
dp = [[0]*100010 for _ in range(102)]

# DP テーブル全体を初期化
for i in range(102):
    for j in range(100010):
        dp[i][j] = 0# 最大化問題

# DP ループ
# v-1 番目の荷物に対する情報を dp[v] に記録
for v in range(1,N+1):
    for w in range(W+1):
        # v-1 番目の品物を選ぶ場合
        if (w - weight[v-1]) >= 0:
            dp[v][w] = max(dp[v][w],dp[v-1][w - weight[v-1]] + value[v-1])
        # v-1 番目の品物を選ばない場合
        dp[v][w] =  max(dp[v][w],dp[v-1][w])
        
# 価値の総和の最大値を出力
print(dp[N][W])

Buggy submission (verdict: Runtime Error):
import sys
# inputを高速化する。
input = sys.stdin.readline
# 入力
vacation = int(input())
lst_happiness = [list(map(int, input().split())) for i in range(vacation)]
# DPテーブル
# 最大化問題なので0で初期化
dp = [[0 for i in range(3)] for j in range(vacation+1)]
def chmax(a, b):
    if a > b:
        return a
    else:
        return b
# dp[i][0] から dp[i + 1][1] への遷移
# dp[i][0] から dp[i + 1][2] への遷移
# dp[i][1] から dp[i + 1][0] への遷移
# dp[i][1] から dp[i + 1][2] への遷移
# dp[i][2] から dp[i + 1][0] への遷移
# dp[i][2] から dp[i + 1][1] への遷移
# 各 j (= 0, 1, 2) と各 k (= 0, 1, 2) に対して、j ≠ k ならば
# chmin(dp[i + 1][k], dp[i [j] + lst_happiness[i][k])
for i in range(vacation):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            dp[i+1][k] = chmax(dp[i+1][k], dp[i][j] + lst_happiness[i][k])
ans = 0
for i in range(3):
    ans = chmax(ans, dp[vacation][i])
print(ans)
Problem p03244 (python)

Fixed submission:
#100 C - /\/\/\/
import collections
n = int(input())
A = list(map(int,input().split()))

A1 = A[::2]
A2 = A[1::2]
cnt1 = collections.Counter(A1)
cnt2 = collections.Counter(A2)

items1 = list(cnt1.items())
items2 = list(cnt2.items())
items1 = sorted(items1,key = lambda x:x[1],reverse = True)
items2 = sorted(items2,key = lambda x:x[1],reverse = True)

if items1[0][0] != items2[0][0]:
    ans = (len(A1) - items1[0][1]) + (len(A2) - items2[0][1])
else:
    if len(items1) == len(items2) == 1:
        ans = min(len(A1),len(A2))

    else:
        ans1 = (len(A1) - items1[0][1]) + (len(A2) - items2[1][1])
        ans2 = (len(A1) - items1[1][1]) + (len(A2) - items2[0][1])
        ans = min(ans1,ans2)
print(ans)

Buggy submission (verdict: Runtime Error):
#100 C - /\/\/\/ AC
import collections
n = int(input())
A = list(map(int,input().split()))

A1 = A[::2]
A2 = A[1::2]
cnt1 = collections.Counter(A1)
cnt2 = collections.Counter(A2)

items1 = list(cnt1.most_comon())
items2 = list(cnt2.most_comon())

if items1[0][0] != items2[0][0]:
    ans = (len(A1) - items1[0][1]) + (len(A2) - items2[0][1])
else:
    if len(items1) == len(items2) == 1:
        ans = min(len(A1),len(A2))

    else:
        ans1 = (len(A1) - items1[0][1]) + (len(A2) - items2[1][1])
        ans2 = (len(A1) - items1[1][1]) + (len(A2) - items2[0][1])
        ans = min(ans1,ans2)
print(ans)

Buggy submission (verdict: Runtime Error):
#100 C - /\/\/\/
import collections
n = int(input())
A = list(map(int,input().split()))

A1 = A[::2]
A2 = A[1::2]
cnt1 = collections.Counter(A1)
cnt2 = collections.Counter(A2)

items1 = list(cnt1.items())
items2 = list(cnt2.items())

if items1[0][0] != items2[0][0]:
    ans = (len(A1) - items1[0][1]) + (len(A2) - items2[0][1])
else:
    ans1 = (len(A1) - items1[0][1]) + (len(A2) - items2[1][1])
    ans2 = (len(A1) - items1[1][1]) + (len(A2) - items2[0][1])
    ans = min(ans1,ans2)
print(ans)
Problem p03369 (python)

Fixed submission:
S = input()
cnt = S.count('o')
print(700+100*cnt)

Buggy submission (verdict: Runtime Error):
A,B,C,X,Y = map(int,input().split())

#全部Cで買うとき
a = 2*C*min(X,Y) + 2*C*(max(X,Y)-min(X,Y))

#片方を全部Cで買うとき
if X > Y:
    b = 2*C*Y + (X-Y)*A
elif Y > X:
    b = 2*C*X + (Y-X)*B
else:
    b = a
print(b)
    
#全部AとBで買うとき
c = A*X + B*Y
print(c)

print(min(a,b,c))
Problem p03371 (python)

Fixed submission:
A,B,C,X,Y = map(int,input().split())

#全部Cで買うとき
a = 2*C*min(X,Y) + 2*C*(max(X,Y)-min(X,Y))

#片方を全部Cで買うとき
if X > Y:
    b = 2*C*Y + (X-Y)*A
elif Y > X:
    b = 2*C*X + (Y-X)*B
else:
    b = a
    
#全部AとBで買うとき
c = A*X + B*Y

print(min(a,b,c))

Buggy submission (verdict: Runtime Error):
A,B,C,X,Y = map(int,input().split())

#全部Cで買うとき
a = 2*C*min(X,Y) + 2*C*(max(X,Y)-min(X,Y))

#片方を全部Cで買うとき
if X > Y:
    b = 2*C*Y + (X-Y)*A
elif Y > X:
    b = 2*C*X + (Y-X)*A

#全部AとBで買うとき
c = A*X + B*Y

print(min(a,b,c))
Problem p03457 (python)

Fixed submission:
#13 C - Traveling
N = int(input())

plan = []
for _ in range(N):
    ti,xi,yi = map(int,input().split())
    plan.append((ti,xi,yi))
    
#今いる場所の座標と時間
spot = (0,0,0)#始点
result = 'Yes'
for t,x,y in plan:
    tdiff = t-spot[0]
    xdiff = abs(x-spot[1])
    ydiff = abs(y-spot[2])
    #(x,y)の変化量の和の偶奇と時間の差の偶奇が一致している
    #時間の変化量より(x,y)の変化量の方が小さい
    if (tdiff%2 == (xdiff+ydiff)%2) and ((xdiff + ydiff)<=tdiff):
        '''
        xdiff<=tdiff and ydiff<=t だと(3,3,2)などの範囲外に対応できない
        if (tdiff%2 == (xdiff+ydiff)%2) and (xdiff<=tdiff) and (ydiff<=tdiff):
        '''
        spot = (t,x,y)
    else:
        result = 'No'
        break
print(result)

Buggy submission (verdict: Runtime Error):
#13 C - Traveling
N = int(input())

plan = []
for _ in range(N):
    ti,xi,yi = map(int,input().split())
    plan.append((ti,xi,yi))
    
#今いる場所の座標と時間
spot = (0,0,0)#始点
result = 'Yes'
for t,x,y in plan:
    tdiff = t-spot[0]
    xdiff = abs(x-spot[1])
    ydiff = abs(y-spot[2])
    #(x,y)の変化量の和の偶奇と時間の差の偶奇が一致している
    #時間の変化量より(x,y)の変化量の方が小さい
    if (tdiff%2 == (xdiff+ydiff)%2) and ((xdiff + ydiff)<=tdiff):
    '''
    xdiff<=tdiff and ydiff<=t だと(3,3,2)などの範囲外に対応できない
    if (tdiff%2 == (xdiff+ydiff)%2) and (xdiff<=tdiff) and (ydiff<=tdiff):
    '''
        spot = (t,x,y)
    else:
        result = 'No'
        break
print(result)
Problem p03547 (python)

Fixed submission:
X,Y = map(ord,input().split())

if X > Y:
  print('>')
elif X < Y:
  print('<')
else:
  print('=')

Buggy submission (verdict: Runtime Error):
#78 C - HSI
N,M = map(int,input().split())
# 全て AC となる確率
p = (1/2)**M

# E = 1/p になる
E = 1/p
ans = (1900*M + 100*(N-M))*E
ans = round(ans)
print(ans)
Problem p03645 (python)

Fixed submission:
#55 C - Cat Snuke and a Voyage
from collections import deque
N,M = map(int,input().split())
G = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1; b -= 1
    G[a].append(b)
    G[b].append(a)

# BFS のためのデータ構造
dist = [-1]*N
que = deque([])

# 初期条件 (島 1 を初期ノードとする)
dist[0] = 0
que.append(0)

while (len(que) != 0):
    v = que.popleft()# キューから先頭頂点を取り出す
    for next_v in G[v]:
        if (dist[next_v] != -1):# next_v が探索済みならスルー
            continue
        #新たな頂点 next_v について情報を更新してキューに追加
        dist[next_v] = dist[v] + 1
        que.append(next_v)
        
if dist[N-1] == 2:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
#55 C - Cat Snuke and a Voyage
import collections from deque
N,M = map(int,input().split())
G = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1; b -= 1
    G[a].append(b)
    G[b].append(a)

# BFS のためのデータ構造
dist = [-1]*N
que = deque([])

# 初期条件 (島 1 を初期ノードとする)
dist[0] = 0
que.append(0)

while (len(que) != 0):
    v = que.popleft()# キューから先頭頂点を取り出す
    for next_v in G[v]:
        if (dist[next_v] != -1):# next_v が探索済みならスルー
            continue
        #新たな頂点 next_v について情報を更新してキューに追加
        dist[next_v] = dist[v] + 1
        que.append(next_v)
if dist[N-1] == 2:
    print('POSSIBLE')
else:
    print('INPOSSIBLE')

Buggy submission (verdict: Runtime Error):
#55 C - Cat Snuke and a Voyage
N,M = map(int,input().split())
G = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1; b -= 1
    G[a].append(b)
    G[b].append(a)

# BFS のためのデータ構造
dist = [-1]*N
que = deque([])

# 初期条件 (島 1 を初期ノードとする)
dist[0] = 0
que.append(0)

while (len(que) != 0):
    v = que.popleft()# キューから先頭頂点を取り出す
    for next_v in G[v]:
        if (dist[next_v] != -1):# next_v が探索済みならスルー
            continue
        #新たな頂点 next_v について情報を更新してキューに追加
        dist[next_v] = dist[v] + 1
        que.append(next_v)
if dist[N-1] == 2:
    print('POSSIBLE')
else:
    print('INPOSSIBLE')

Buggy submission (verdict: Runtime Error):
#55 C - Cat Snuke and a Voyage
N,M = map(int,input().split())
G = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1; b -= 1
    G[a].append(b)
    G[b].append(a)
print(G)

# BFS のためのデータ構造
dist = [-1]*N
que = deque([])

# 初期条件 (島 1 を初期ノードとする)
dist[0] = 0
que.append(0)

while (len(que) != 0):
    v = que.popleft()# キューから先頭頂点を取り出す
    for next_v in G[v]:
        if (dist[next_v] != -1):# next_v が探索済みならスルー
            continue
        #新たな頂点 next_v について情報を更新してキューに追加
        dist[next_v] = dist[v] + 1
        que.append(next_v)
if dist[N-1] == 2:
    print('POSSIBLE')
else:
    print('INPOSSIBLE')
Problem p03693 (python)

Fixed submission:
r,g,b = map(str,input().split())
list_C = [r,g,b]
num = int(''.join(list_C))
if num%4 == 0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
r,g,b = map(str,input().split())
list_C = [r,g,b]
num = int(''.join(list_c))
if num%4 == 0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
#C - Colorful Leaderboard 
N = int(input())
a = list(map(int,input().split()))

mini = 0
color_list = []
for i in a:
    if (i//400)<8 and ((i//400 in color_list) == False):
        mini += 1
        color_list.append(i//400)

maxi = mini
for j in a:
    if maxi == 8:
        break
    if j >= 3200:
        maxi += 1
if mini == 0:#忘れてた
    mini = 1
print(mini,maxi)
Problem p03838 (python)

Fixed submission:
# A - Simple Calculator
x,y = map(int,input().split())

# 初めと終わりに B を押すとき
ans1 = -y - (-x) + 2
# 初めだけ B を押すとき
ans2 = y - (-x) + 1
# 終わりだけ B を押すとき
ans3 = -y - x + 1
# B を押さないとき
ans4 = y - x

ans = [ans1,ans2,ans3,ans4]
ans = [a for a in ans if a > 0]
ans = min(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
# A - Simple Calculator
x,y = map(int,input().split())

if y > x:
    ans = y - x
else:
    # B を押す
    if x != 0:
        x *= -1
        ans = 1
    # y の絶対値との差分を押す
    ans += max(abs(x),abs(y)) - min(abs(x),abs(y))
    x += max(abs(x),abs(y)) - min(abs(x),abs(y))
    # B を押す
    if x != y:
        ans += 1
print(ans)
Problem p03944 (python)

Fixed submission:
# 63 B - すぬけ君の塗り絵 2 イージー
W,H,N = map(int,input().split())

X = []
Y = []
A = []
for _ in range(N):
    x,y,a = map(int,input().split())
    x -= 1;y -= 1
    X.append(x)
    Y.append(y)
    A.append(a)

mtrx = [['.']*W for _ in range(H)]

for a,(x,y) in zip(A,zip(X,Y)):
    if a == 1:
        for i in range(H):
            for j in range(x+1):
                mtrx[i][j] = '#'
    if a == 2:
        for i in range(H):
            for j in range(x+1,W):
                mtrx[i][j] = '#'
    if a == 3:
        for i in range(y+1):
            mtrx[i] = ['#']*W
    if a == 4:
        for i in range(y+1,H):
            mtrx[i] = ['#']*W

ans = 0
for i in range(H):
    for j in range(W):
        if mtrx[i][j] == '.':
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
# 63 B - すぬけ君の塗り絵 2 イージー
W,H,N = map(int,input().split())

X = []
Y = []
A = []
for _ in range(N):
    x,y,a = map(int,input().split())
    x -= 1;y -= 1
    X.append(x)
    Y.append(y)
    A.append(a)

mtrx = [['.']*W for _ in range(H)]

for a,(x,y) in zip(A,zip(X,Y)):
    if a == 1:
        for i in range(H):
            for j in range(x+1):
                mtrx[i][j] = '#'
    if a == 2:
        for i in range(H):
            for j in range(x+1,W):
                mtrx[i][j] = '#'
    if a == 3:
        for i in range(y+1):
            mtrx[i] = ['#']*W
    if a == 4:
        for i in range(y+1,W):
            mtrx[i] = ['#']*W
ans = 0
for i in range(H):
    for j in range(W):
        if mtrx[i][j] == '.':
            ans += 1
print(ans)
Problem p02632 (python)

Fixed submission:
k = int(input())
s = len(input())
MOD = 10 ** 9 + 7


def mod_inv(n):
    return pow(n, MOD - 2, MOD)

total = pow(26, k + s, MOD)
tmp = pow(25, k + s, MOD)
total = (total - tmp) % MOD

for i in range(0, s-1):
    tmp = ((tmp * ((k+s) - i)) % MOD * mod_inv((i + 1) * 25)) % MOD
    total = (total - tmp) % MOD
print(total)

Buggy submission (verdict: Runtime Error):
k = int(input())
s = len(input())
MOD = 10 ** 9 + 7


def mod_inv(n):
    return pow(n, MOD - 2, MOD)


dp1 = [0 for i in range(s)]
dp1[0] = 25
dp1[1] = 1
dp2 = [0 for i in range(s)]
# 1moji
sum_not_0 = 1
end = 1
# 2moji kara s+k moji

total = pow(26, k + s, MOD)
tmp = pow(25, k + s, MOD)
print(total,tmp)
total = (total - tmp) % MOD

for i in range(0, s-1):
    tmp = ((tmp * ((k+s) - i)) % MOD * mod_inv((i + 1) * 25)) % MOD
#    print(tmp)
    total = (total - tmp) % MOD
print(total)
Problem p02743 (python)

Fixed submission:
a,b,c=map(int,input().split())

d=c-a-b

if d<0:
    print('No')
elif 4*a*b<d*d:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())

d=c-a-b

if d<0:
    print('No')
elif 4*a*b<d*d
    print('Yes')
else:
    print('No')
Problem p02791 (python)

Fixed submission:
n=int(input())
 
P=list(map(int,input().split()))
 
min=P[0]
count=0
for i in P:
    if min>=i:
        count+=1
        min=i
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input()

P=list(map(int,input().split()))

min=P[0]
count=0
for i in P:
    if min>=i:
        count+=1
        min=i
print(count)
Problem p03160 (python)

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

dp= [0]*n
dp[0]=0
dp[1]=abs(h[1]-h[0])
for i in range(2,n):
  dp[i]=min(dp[i-2]+abs(h[i]-h[i-2]), dp[i-1]+abs(h[i]-h[i-1]))
 
print(dp[n-1])

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

dp[0]=0
dp[1]=abs(h[1]-h[0])
for i in range(2,n):
  dp[i]=min(dp[i-2]+abs(h[i]-h[i-2]), dp[i-1]+abs(h[i]-h[i-1]))

print(dp[n-1])
Problem p02612 (python)

Fixed submission:
N = float(input())
if int(N) % 1000 == 0:
    print(0)
else:
    M = (int(N / 1000) + 1) * 1000
    print(int(M - N))

Buggy submission (verdict: Runtime Error):
N = int(input())
a, w, t, r = 0, 0, 0, 0
for i in range(N):
    S = input()
    if S == 'AC':
        a += 1
    elif S == 'WA':
        w += 1
    elif S == 'TLE':
        t += 1
    else:
        r += 1
print('AC × ' + str(a))
print('WA × ' + str(w))
print('TLE × ' + str(t))
print('RE × ' + str(r))
Problem p02641 (python)

Fixed submission:
x, n = map(int,input().split())
p = list(map(int,input().split()))
y = 0
z = 0
while y == 0:
    a = x + z
    b = x - z
    if a in p and b in p:
        z += 1
    elif a not in p and b in p:
        print(a)
        y = 4
    elif b not in p:
        print(b)
        y = 5

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

y = []
z = []
for i in range(n):
    if x - p[i] >= 0:
        y.append(x - p[i])
    else:
        z.append(p[i] - x)



y = sorted(y)
z = sorted(z)

if y[0] == z[0]:
    print(y[0])
elif y[0] > z[0]:
    print(z[0])
else:
    print(y[0])

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

y = []
z = []
for i in range(n):
    if x - n[i] >= 0:
        y.append(x - n[i])
    else:
        z.append(n[i] - x)



y = sorted(y)
z = sorted(z)

if y[0] == z[0]:
    print(y[0])
elif y[0] > z[0]:
    print(z[0])
else:
    print(y[0])
Problem p02657 (python)

Fixed submission:
A, B = list(map(int, input().split()))
print(A * B)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print(A * B)
Problem p02705 (python)

Fixed submission:
import math
pi = math.pi
r = int(input())
print(2 * r * pi)

Buggy submission (verdict: Runtime Error):
import math
r = input()
print(2 * r * math.pi)
Problem p02741 (python)

Fixed submission:
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())
print(a[K - 1])

Buggy submission (verdict: Runtime Error):
H, W = map(int,input().split())
import math
if H == 1 or W == 1:
    print(1)
    exit()

if H % 2 == 0:
    print(H // 2 * W)
else:
    print(int(H // 2 * W + math.ceil(W / 2)))
Problem p02760 (python)

Fixed submission:
A = []
a1 = []
a2 = []
a3 = []
for i in range(3):
    a = list(map(int,input().split()))
    for K in range(3):
        A.append(a[K])


N = int(input())
for i in range(N):
    b = int(input())
    for k in range(9):
        if b == A[k]:
            A[k] = 0




for i in range(9):
    if 0 <= i <= 2:
        a1.append(A[i])
    elif 3 <= i <= 5:
        a2.append(A[i])
    else:
        a3.append(A[i])

x = 0
y = 0
z = 0
for i in range(3):
    if a1[i] == 0:
        x += 1
    if a2[i] == 0:
        y += 1
    if a3[i] == 0:
        z += 1

if x == 3 or y == 3 or z == 3:
    print('Yes')
    exit()

for i in range(3):
    if a1[i] == 0 and a2[i] == 0 and a3[i] == 0:
        print('Yes')
        exit()

if a2[1] == 0:
    if a1[0] == 0 and a3[2] == 0 or a1[2] == 0 and a3[0] == 0:
        print('Yes')
        exit()

print('No')

Buggy submission (verdict: Runtime Error):
a1 = list(map(int,input().split()))
a2 =list(map(int,input().split()))
a3 =list(map(int,input().split()))
n = int(input())
b = []

for i in range(1,n + 1):
    bc = int(input())
    b.append(bc)

for i in range(n):
    for m in range(3):
        if a1[m] == b[i]:
            a1[m] = 0
        elif a2[m] == b[i]:
            a2[m] = 0
        elif a3[m] == b[i]:
            a3[m] = 0

for i in range(3):
    if a1[i] == 0 and a2[i] == 0 and a3[i] == 0:
        print('縦')
        exit()

if a1.count(0) == 3 or a2.count(0) ==3 or a3.count(0) == 3:
    print('横')
    exit()

if a2[2] == 0:
    if a1[1] == 0 and a3[3] == 0 or a3[1] ==0 and a1[3] == 0:
        print('斜め')
        exit()

print('No')
Problem p02957 (python)

Fixed submission:
a, b = map(int,input().split())
x = a + b
if x % 2 == 0:
    print(x // 2)
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
x = a + b
if x % 2 == 0:
    print(s / 2)
else:
    print('IMPOSSIBLE')
Problem p03282 (python)

Fixed submission:
S = input()
K = int(input())

for i in range(K):
    if S[i] != '1':
        print(S[i])
        exit()
    
    if i == K - 1:
        print('1')
        exit()

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())

for i in range(K):
    if S[i] != '1':
        print(S[i])
        exit()
    
    if i == k - 1:
        print('1')
        exit()
Problem p03644 (python)

Fixed submission:
N = int(input())
x = 1

while x <= N:
    x *= 2
    
 
print(x // 2)

Buggy submission (verdict: Runtime Error):
N = int(input())
x = 0
a = []
for i in range(2,N,2):
    while i % 2 == 0:
        i //= 2
        x += 1
    a.append(x)
    x = 0
a = sorted(a)
a = a[::-1]
print(a[0])

Buggy submission (verdict: Runtime Error):
N = int(input())
x = 0
a = []
for i in range(2,N,2):
    while i % 2 == 0:
        i //= 2
        x += 1
    a.append(x)
    x = 0
a = sorted(a)
a = a[::-1]
print(a[0])
Problem p02553 (python)

Fixed submission:
a,b,c,d = map(int, input().split())
print(max([a*c,a*d,b*c,b*d]))

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(input())
print max(a*c,a*d,b*c,b*d)
Problem p02741 (python)

Fixed submission:
a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[int(input())-1])

Buggy submission (verdict: Runtime Error):
import math
a,b,c=map(int,input().split())
if(math.sqrt(a)+math.sqrt(b)<=math.sqrt(c)):
	print("Yes")
else:
	print("No")