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

Fixed submission:
a,b,c=map(int,input().split())
k=int(input())
for n in range(k):
  if a>=b:
    b=b*2
  elif b>=c:
    c=c*2
if b>a and c>b:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
k=int(input())
B=b
for n in range(k):
  if a>b:
    b=b*2
  else:
    break
e=b/B
f=e//2
for m in range(k-f):
  if b>c:
    c=c*2
  else:
    break
if b>a and c>b:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
k=int(input())
B=b
for n in range(k):
  if a>b:
    b=b*2
  else:
    break
e=b/B
for n in range(k-e):
  if b>c:
    c=c*2
  else:
    break
if b>a and c>b:
  print('Yes')
else:
  print('No')
Problem p02606 (python)

Fixed submission:
L,R,d=map(int,input().split())
a=L//d
b=R//d
c=L%d
if c==0:
  print(b-a+1)
else:
  print(b-a)

Buggy submission (verdict: Runtime Error):
L=int(input())
R=int(input())
d=int(input())
a=L // d
b=R // d
c=L % d
if c==0:
  print(b-a+1)
else:
  print(b-a)

Buggy submission (verdict: Runtime Error):
L=int(input())
R=int(input())
d=int(input())
a=L//d
b=R//d
c=L%d
if c==0:
  print(b-a+1)
else:
  print(b-a)
Problem p02608 (python)

Fixed submission:
n=int(input())
a=[0]*10001
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      v=i**2+j**2+k**2+i*j+j*k+k*i
      if v<10001:
        a[v]+=1
for m in range(n):
  print(a[m+1])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[0]*10001
for i in range(101):
  for j in range(101):
    for k in range(101):
      v=i**2+j**2+k**2+i*j+j*k+k*i
      if v<=10001:
        a[v]+=1
for m in range(n):
  print(a[m+1])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[ 0 for _ in range (10000)]
for i in range(100):
  for j in range(100):
    for k in range(100):
      v=i**2+j**2+k**2+i*j+j*k+k*i
      if v<=10000:
        a[v]+=1
for m in range(n):
  print(a[m+1])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[ 0 for _ in range (10000)]
for i in range(100):
  for J in range(100):
    for k in range(100):
      v=i**2+j**2+k**2+i*J+j*k+k*i
      if v<=10000:
        a[v]+=1
for m in range(n):
  print(a[m+1])
Problem p02613 (python)

Fixed submission:
n=int(input())
ac=0
wa=0
tle=0
re=0
for m in range(n):
  a=input()
  if a=='AC':
    ac=ac+1
  elif a=='WA':
    wa=wa+1
  elif a=='TLE':
    tle=tle+1
  else:
    re=re+1
print('AC x '+str(ac))
print('WA x '+str(wa))
print('TLE x '+str(tle))
print('RE x '+str(re))

Buggy submission (verdict: Runtime Error):
n=int(input())
ac=0
wa=0
tle=0
re=0
for m in range(n):
  a=input()
  if a=='AC':
    ac=ac+1
  elif a=='WA':
    wa=wa+1
  elif a=='TLE':
    tle=tle+1
  else:
    re=re+1
print('AC x %ac' % ac)
print('WA x %wa' % wa)
print('TLE x %tle' % tle)
print('RE x %re' % re)
Problem p02658 (python)

Fixed submission:
n=int(input())
array=list(map(int,input().split()))
ans=1
if 0 in array:
  ans=0
else:
  for i in range(n):
    if ans>10**18:
      break
    else:
      ans=ans*array[i]
if ans>10**18:
  print(-1)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
array=list(map(int,input().split()))
ans=1
if 0 in array:
  ans=0
else:
  for i in range(n):
  if ans>10**18:
    break
  else:
    ans=ans*array[i]
if ans>10**18:
  print(-1)
else:
  print(ans)
Problem p02675 (python)

Fixed submission:
N=int(input())
a=N%10
if a==3:
  print('bon')
elif a==0 or a==1 or a==6 or a==8:
  print('pon')
else:
  print('hon')

Buggy submission (verdict: Runtime Error):
N=int(input())
a=N%10
if a==2,4,5,7,9:
  print('hon')
elif a==0,1,6,8:
  print('pon')
else:
  print('bon')
Problem p02717 (python)

Fixed submission:
x,y,z=map(int,input().split())
print(z, x, y)

Buggy submission (verdict: Runtime Error):
x,y,z=map(int,input().split())
print(z x y)
Problem p02582 (python)

Fixed submission:
def main():
    s = input()
    if s == "RSR":
        print(1)
    else:
        cnt = 0
        for i in s:
            if i == "R":
                cnt += 1

        print(cnt)
    
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    x, k, d = map(int, input().split())
    # x > 0
    if x < 0:
        x = -1 * x
    #the number of d in x
    r = abs(x) // d
    k_rest = k - r
    if r > 0 and k_rest < 0:
        print(x - k * d)
        exit()

    x_r = x - d * r
    x_l = x_r - d

    # print(f"xr: {x_r}\nxl: {x_l}\nk: {k_rest}")

    if k_rest % 2 == 0:
        print(abs(x_r))
    else:
        print(abs(x_l))

if __name__ == "__main__":
    main()
Problem p02760 (python)

Fixed submission:
def main():
    a = [list(map(int, input().split())) for _ in range(3)]
    n = int(input())
    b = [int(input()) for _ in range(n)]
    card = [[False]*3 for _ in range(3)]
    for i in range(3):
        for j in range(3):
            if a[i][j] in b:
                card[i][j] = True

    ans = "No"
    for i in range(3): #横に見てる
        if card[i][0] and card[i][1] and card[i][2]:
            ans = "Yes"
    for i in range(3): # 縦に見てる
        if card[0][i] and card[1][i] and card[2][i]:
            ans = "Yes"
    if card[0][0] and card[1][1] and card[2][2]:
        ans = "Yes"
    if card[0][2] and card[1][1] and card[2][0]:
        ans = "Yes"
    print(ans)

    
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    a = [list(map(int, input().split())) for _ in range(3)]
    n = int(input())
    b = [int(input()) for _ in range(n)]
    card = [[0]*3]*3
    for i in range(n):
        for j in range(n):
            card[i][j]  == False
            for k in range(n):
                if a[i][j] == b[k]:
                    card[i][j] = True
    ans = "No"
    for i in range(3): #横に見てる
        if card[i][0] and card[i][1] and card[i][2]:
            ans = "Yes"
    for i in range(3): # 縦に見てる
        if card[0][i] and card[1][i] and card[2][i]:
            ans = "Yes"
    if card[0][0] and card[1][1] and card[2][2]:
        ans = "Yes"
    if card[0][2] and card[1][1] and card[2][0]:
        ans = "Yes"
    print(ans)

    
if __name__ == "__main__":
    main()
Problem p02761 (python)

Fixed submission:
def main():
    n, m = map(int, input().split())
    s, c = []*m, []*m
    for i in range(m):
        a, b = map(int, input().split())
        s.append(a), c.append(b)
    for i in range(0, 10 ** n):
        loop = True
        string = str(i)
        if len(string) != n:
            continue
        for j in range(m):
            if string[s[j] - 1] != str(c[j]):
                loop = False
        if loop:
            print(string)
            quit()
    print(-1)
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n, m = map(int, input().split())
    s, c = []*m, []*m
    for i in range(m):
        a, b = map(int, input())
        s.append(a), c.append(b)
    for i in range(0, 10 ** n):
        loop = True
        string = str(i)
        if len(string) != n:
            continue
        for j in range(m):
            if string[s[j] - 1] != str(c[j]):
                loop = False
        if loop:
            print(string)
            quit()
    print(-1)
if __name__ == "__main__":
    main()
Problem p02783 (python)

Fixed submission:

def main():
    H, A = map(int, input().split())
    count = 0
    while True:
        H -= A
        count += 1
        if H <= 0:
            break

    print(count)





if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    import math

    H = int(input())
    if H == 1:
        print(1)
    else:
        count = int(math.log(H, 2))
        ans = 0
        for i in range(count+1):
            ans += 2 ** (i)
            print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    H = int(input())
    if H == 1:
        print(1)
    else:
        count = int(math.log(H, 2))
        ans = 0
        for i in range(count+1):
            ans += 2 ** (i)
            print(ans)

if __name__ == "__main__":
    main()
Problem p02802 (python)

Fixed submission:
def main():
    N, M= map(int, input().split())
    
    acList = [False] * N
    waList = [0] * N
    waCount = 0

    for _ in range(M):
        p, s = map(str, input().split())
        p = int(p) - 1
        if acList[p]:
            continue
        if s == "WA":
            waList[p] += 1
            continue
        waCount += waList[p]
        acList[p] = True

    print(sum(acList), waCount)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N, M= map(int, input().split())
    
    acList = [False] * N
    waList = [0] * N
    waCount = 0

    for _ in range(M):
        p, s = map(str, input().split())
        p = int(p) - 1
        if atList[p]:
            continue
        if s == "WA":
            waList[p] += 1
            continue
        waCount += waList[p]
        acList[p] = True

    print(sum(acList), waCount)

if __name__ == "__main__":
    main()
Problem p02844 (python)

Fixed submission:
def solution1():

    # 入力
    n = int(input())
    s = [int(i) for i in input()]
    cnt = 0
    for c in range(1000):
        # 100の桁、１０の桁、１の桁に分解
        candidate = [c//100, (c//10)%10, c%10]
        f = -1
        for j in range(n):
            if s[j] == candidate[f]:
                f += 1
            if f == 2:
                break
        if f == 2:
            cnt += 1
    print(cnt)

if __name__ == "__main__":
    solution1()

Buggy submission (verdict: Runtime Error):


# 000から９９９まで決め打ちで全探索。計算量はO(1000*N)程度
def solution1():

    # 入力
    n = int(input())
    s = [int(i) for i in input()]
    cnt = 0
    for c in range(1000):
        candidate = [c/100, (c/10)%10, c%10]
        f = 0
        for j in range(n):
            if s[j] == ("0" + candidate[f]):
                f += 1
            if f == 2:
                break
        if f == 2:
            cnt += 1
    print(cnt)
if __name__ == "__main__":
    solution1()
Problem p02885 (python)

Fixed submission:
a, b = map(int, input().split(" "))
if a > 2*b :
    print(a-2*b)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split(","))
if a > 2*b :
    print(a-2*b)
print(0)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split(","))
if a > b :
    print(a-b)
print(0)

Buggy submission (verdict: Runtime Error):
a,b = input().split(',')
if a > b:
  print(a-b)
print(0)

Buggy submission (verdict: Runtime Error):
a,b = map(int, inpout().split())
if a > b:
  print(a-b)
print(0)
Problem p02969 (python)

Fixed submission:
def main():
    r = int(input())
    print( 3 * r ** 2)
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    p_l = list(map(int, input().split()))
    cnt = 0
    for i in range(n):
        if p_l[i] == i + 1: continue
        else: cnt += 1
    if cnt > 2: print("NO")
    else: print("YES")
if __name__ == "__main__":
    main()
Problem p03031 (python)

Fixed submission:
#bit & 演算子は同じ位置のbitが１の時１を返す
def main():
    n, m = map(int, input().split())
    # ｋは何個のスイッチにつながっているか、ｓはスイッチの番号
    s = []; k = [] # s : どのスイッチとつながってるか、インデックスは電球を指す、　k: 電球が何個のスイッチとつながっているか
    for _ in range(m):
        tmp = list(map(int, input().split()))
        s.append(tmp[1:]); k.append(tmp[0])
    p = list(map(int, input().split()))

    res = 0
    # スイッチの状態は２進数表記で表す。スイッチはｎ個あるので
    for bit in range(2**n):
        ok = True
        for i in range(m): # 各電球に対して見ていく
            cnt = 0
            for v in s[i]: # 各電球につながっているスイッチを見てる
                if ( bit & 1 << (v - 1) ): # bitの状態がスイッチvがついてる状態なのかどうか
                    cnt += 1
            if cnt % 2 != p[i]:
                ok = False
        if ok: # okなら全ての電球が付いているということ
            res += 1

    print(res)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

#bit & 演算子は同じ位置のbitが１の時１を返す

def main():
    n, m = map(int, input().split())
    # ｋは何個のスイッチにつながっているか、ｓはスイッチの番号
    s = []; k = [] # s : どのスイッチとつながってるか、インデックスは電球を指す、　k: 電球が何個のスイッチとつながっているか
    for _ in range(m):
        tmp_k, *tmp_s = list(map(int, input().split()))
        k.append(tmp_k); s.append(tmp_s)
    p = list(map(int, input().split()))

    res = 0
    # スイッチの状態は２進数表記で表す。スイッチはｎ個あるので
    for bit in range(2**n):
        ok = True
        for i in range(m): # 各電球に対して見ていく
            cnt = 0
            for v in s[i]: # 各電球につながっているスイッチを見てる
                if ( bit & 1 << (v - 1) ): # bitの状態がスイッチvがついてる状態なのかどうか
            if cnt % 2 != p[i]:
                ok = False
        if ok: # okなら全ての電球が付いているということ
            res += 1

    print(res)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

# bit & 演算子は同じ位置のbitが１の時１を返す

def main():
    n, m = map(int, input().split())
    # ｋは何個のスイッチにつながっているか、ｓはスイッチの番号
    s = []; k = [] # s : どのスイッチとつながってるか、インデックスは電球を指す、　k: 電球が何個のスイッチとつながっているか
    for _ in range(m):
        tmp_k, *tmp_s = list(map(int, input().split()))
        k.append(tmp_k); s.append(tmp_s)
    p = list(map(int, input().split()))

    res = 0
    # スイッチの状態は２進数表記で表す。スイッチはｎ個あるので
    for bit in range(2**n):
        ok = True
        for i in range(m): # 各電球に対して見ていく
            cnt = 0
            for v in s[i]: # 各電球につながっているスイッチを見てる
                if ( bit & 1 << (v - 1) ): # bitの状態がスイッチvがついてる状態なのかどうか
            if cnt % 2 != p[i]:
                ok = False
        if ok: # okなら全ての電球が付いているということ
            res += 1

    print(res)



if __name__ == "__main__":
    main()
Problem p03331 (python)

Fixed submission:


#　各桁の和を計算する
def findSumOfDigits(n):
    sum_digits = 0
    while n > 0 :
        sum_digits += n % 10
        n //= 10
    return sum_digits


def main()->None:
    N = int(input())
    # AとBの各桁の和を求める。
    range_A = range(1,N+1)
    min_total = 100000
    for a in range_A:
        b = N - a
        if b < 1 : continue
        sum_a = findSumOfDigits(a)
        sum_b = findSumOfDigits(b)
        total = sum_a + sum_b
        if total < min_total:
            min_total = total
    print(min_total)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def findSumOfDigits(n):
    sum_digits = 0
    while n > 0 :
        sum_digits += n % 10
        n //= 10
    return sum_digits

N = int(input())
range_A = range(2,100001)
min_total = 1000
for a in range_A:
	b = N - a
    if b < 1:continue
	sum_a = findSumOfDigits(a)
	sum_b = findSumOfDigits(b)
	total = sum_a + sum_b
	if total < min_total:
	min_total = total
print(min_total)

Buggy submission (verdict: Runtime Error):
N = int(input())
range_A = range(2,100001)
min_total = 1000
for a in range_A:
	b = N - a
	if b < 1:continue
	sum_a = findSumOfDigits(a)
	sum_b = findSumOfDigits(b)
	total = sum_a + sum_b
    if total < min_total:
		min_total = total
print(min_total)

Buggy submission (verdict: Runtime Error):
N = int(input())
range_A = range(2,50)
min_total = 1000
for a in range_A:
	b = abs(N - a)
	sum_a = findSumOfDigits(a)
	sum_b = findSumOfDigits(b)
	total = sum_a + sum_b
	if total < min_total:
		min_total = total
print(min_total)
Problem p03370 (python)

Fixed submission:
N, X = map(int, input().split())
range_N = range(N)
m = []
for i in range_N:
  m.append(int(input()))

min_consump = sum(m)
rest = X - min_consump
if rest != 0:
	max_num = 0
	for consump in m:
		doughnut = rest // consump
		if doughnut > max_num :
			max_num = doughnut
	print(len(m) + max_num)
else:print(len(m))

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
range_N = range(N)
m = []
for i in range_N:
  m.append(int(input()))

# 最低でも消費する量を求める。
min_consump = sum(m)
# 残りのお菓子の元の量
rest = X - min_consump
# 残りの量と、一つのドーナツを作るのに消費する量で最大公約数を求める
if rest != 0:
	max_num = 0
	for consump in m:
      doughnut = rest // consump
      if doughnut > max_num :
        max_num = doughnut
    print(len(m) + max_num)
else:print(len(m))
Problem p03433 (python)

Fixed submission:
N = int(input()) # 支払い金学
A = int(input()) # 1円の枚数
B = N % 500 # ５００円が商枚使われた時の余り、これが１円より多いか少ないかで決める
if B <= A:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input()) # 支払い金学
A = int(input()) # 1円の枚数
range_A = range(A)
flag = False
for a in range_A:
  if (N - a) % 500 == 0:
    flag = True
if flag: print("Yes")
  print("No")
Problem p03469 (python)

Fixed submission:
S = input()
S = S.replace("2017", "2018")
print(S)

Buggy submission (verdict: Runtime Error):
S = input()
S[:4] = "2018"
print(S)
Problem p03485 (python)

Fixed submission:
a, b = map(int, input().split())
print((a + b + 1) // 2)

Buggy submission (verdict: Runtime Error):
s = input()
s＿asc = "".join(sorted(s))
    
t = input()
t_dasc = "".join(sorted(t, reverse=True))

if s_asc < t_desc:
	print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
s＿asc = "".join(sorted(s))
    
t = input()
t_dasc = "".join(sorted(t, reverse=True))

if s_asc < t_desc:
        print("Yes")
else:
        print("No")

Buggy submission (verdict: Runtime Error):
import math
a, b = int(input().split(" "))
c = (a + b)/2 # 平均値
if (a+b) % 2 != 0: # 余りが０以外の時小数点以下をきりあげる必要がある。
  print(math.ceil(c))
else:
  print(c)
Problem p03574 (python)

Fixed submission:


def main()->None:
    # gridの処理
    # 近傍の座標をdx=[-1,0,1], dy=[-1,0,1]を用いて
    # (xx, yy) が　xx = x + dx , yy = y + dy　とできる
    # 参考：http://prd-xxx.hateblo.jp/entry/2017/10/19/205331
    # 入力のグリッドから一点ずつ座標指定して選んでその周囲８マスを調べる。
    H, W = map(int, input().split())
    src = [input() for _ in range(H)]
    ans = []
    for row in src:
        ans.append(list(row))


    dxdy = [(-1,-1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1)]
    for y in range(H):
        for x in range(W):
            if src[y][x] == "#":continue
            c = 0
            for dx, dy in dxdy:
                # 探索範囲はx:0~W, y:0~Hでその周囲８マスを探索する
                if x+dx < 0 or x+dx > W-1 or y+dy < 0 or y+dy > H-1: continue
                if src[y+dy][x+dx] == "#": c += 1
            ans[y][x] = c
    
    for row in ans:
        print("".join(list(map(str, row))))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):


def main()->None:
    # gridの処理
    # 近傍の座標をdx=[-1,0,1], dy=[-1,0,1]を用いて
    # (xx, yy) が　xx = x + dx , yy = y + dy　とできる
    # 参考：http://prd-xxx.hateblo.jp/entry/2017/10/19/205331
    # 入力のグリッドから一点ずつ座標指定して選んでその周囲８マスを調べる。
    H, W = map(int, input().split())
    src = [input() for _ in range(H)]
    ans = []
    for row in src:
        ans.append(list(row))


    dxdy = [(-1,-1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1)]
    for y in range(H):
        for x in range(W):
            if src[y][x] == "#":continue
            c = 0
            for dx, dy in dxdy:
                # 探索範囲はx:0~W, y:0~Hでその周囲８マスを探索する
                if x+dx < 0 or x+dx > W-1 or y+dy < 0 or y+dy > H-1: continue
                if src[y+dy][x+dx] == "#": c += 1
        ans[y][x] = c
    
    for row in ans:
        print("".join(list(map(str, row))))




if __name__ == "__main__":
    main()
Problem p03611 (python)

Fixed submission:
import sys


def main()->None:
    N = int(sys.stdin.readline())
    a = list(map(int, sys.stdin.readline().split()))
    max_a = max(a)
    # print(max_a)
    l = [0 for _ in range(max_a+2)] # 配列の初期化、固定長、位置が配列の数字で要素がカウント
    for i in a:
        l[i] += 1
    res = 0
    for i in range(0, max_a+1):
        tmp = l[i-1]+l[i]+l[i+1]
        res = max(res, tmp)
    print(res)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
a_dict = Counter(a)
keys = a_dict.keys()
max_count = 0
for key in keys:
	tmp_count = 0
	for i in keys:
		if key + 1 == i or key - 1 == i or key == i:
			tmp_count += a_dict[i]
	if tmp_count > max_count:
		max_count = tmp_count
print(max_count)

Buggy submission (verdict: Runtime Error):
from collections import Counter



def main():
    N = int(input())
    a = list(map(int, input().split()))
    a_dict = Counter(a)
    max_count = 0
    for key in a_dict.keys():
        tmp_count = 0
        for i in a_dict.key():
            if abs(key - i) <= 1:
                tmp_count += a_dict[i]
        if tmp_count > max_count:
            max_count = tmp_count
    print(max_count)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from collections import Counter
from typing import List, Set



def main()->None:
    # a_iに１を足すか、１引くか、何もしないかの操作を行って、ある整数個数最大化をする
    # x を決めるとgreedyに決まる。
    # 最後の一つのサンプルがTLEになる。jit の使い方もよくわからん
    N: int = int(input())
    a: List[int] = list(map(int, input().split()))
    set_a: Set[int] = set(a)
    max_count: int = 0
    top = 0
    for a_compo in set_a:
        X: int = a_compo
        tmp_count = 0
        for i in set_a:
            if abs(X - i) <= 1:
                tmp_count += a.count(i)
        if tmp_count > max_count:
            max_count = tmp_count

    print(max_count)

if __name__ == "__main__":
    main()
Problem p03693 (python)

Fixed submission:
r, g, b = input().split(" ")
num = int(r + g + b)
if num % 4 == 0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
r, g, b = input()

num = r + g + b
num = int(num)

if num % 4== 0:
  print("Yes")
else:
  print("No")
Problem p03730 (python)

Fixed submission:


def main():
    # 状態がループする
    A, B, C = map(int, input().split())
    flag = False
    for i in range(1, B+1):
        if i * A % B == C:
            flag = True
    if flag:print("YES")
    else:print("NO")


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):


def main():
    N, K = map(int, input().split())
    res = K * (K -1)**(N-1)

    print(res)

if __name__ == "__main__":
    main()
Problem p03944 (python)

Fixed submission:



def main()->None:
    W, H, N = map(int, input().split())
    range_N = range(N)
    xl, xr, yd, yu = 0, W, 0, H
    for i in range_N:
        x, y, a = map(int, input().split())
        if a == 1:
            xl = max(x, xl)
        elif a == 2:
            xr = min(x, xr)
        elif a == 3:
            yd = max(y, yd)
        else:
            yu = min(y, yu)
    if xl >= xr or yd >= yu:
        print(0)
    else:
        print((xr - xl) * (yu - yd))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):



def main()->None:
    W, H, N = map(int, input().split())
    range_N = range(N)
    xl, xr, yd, yu = 0, w, 0, h
    for i in range_N:
        x, y, a = map(int, input().split())
        if a == 1:
            xl = max(x, xl)
        if a == 2:
            xr = min(x, xr)
        if a == 3:
            yd = max(y, yd)
        else:
            yu = min(y, yu)
    if xl >= xr or yd >= yu:
        print(0)
    else:
        print((xr - xl) * (yu - yd))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):



def main()->None:
    W, H, N = map(int, input().split())
    range_N = range(N)
    xl, xr, yd, yu = 0, w, 0, h
    for i in range_N:
        x, y, a = map(int, input().split()
        if a == 1:
            xl = max(x, xl)
        if a == 2:
            xr = min(x, xr)
        if a == 3:
            yd = max(y, yd)
        else:
            yu = min(y, yu)
    if xl >= xr or yd >= yu:
        print(0)
    else:
        print((xr - xl) * (yu - yd))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):



def main()->None:
    W, H, N = map(int, input().split())
    range_N = range(N)
    xy = []
    a_i = []
    for i in range_N:
        x, y, a = map(int, input().split())
        xy.append([x, y])
        a_i.append(a)
    
    flag = False
    for x, y, a in zip(xy, a_i):
        if a % 4 == 1:
            W -= x
        if a % 4 == 2:
            W -= x
        if a % 4 == 3:
            H -= y
        else:
            H -= y
        if W <= 0 or H <= 0:
            flag = True
            break
    if flag: print(0)
    else: print(W*H)



if __name__ == "__main__":
    main()