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

Fixed submission:
n,q=map(int,input().split())
s=input()
lr = [list(map(int, input().split())) for _ in range(q)]

ruisekiwa=[0]*n
for i in range(n-1):
    if s[i]=="A" and s[i+1]=="C":
        ruisekiwa[i+1]=ruisekiwa[i]+1
    else:
        ruisekiwa[i+1] = ruisekiwa[i]
for i in range(q):
    print(ruisekiwa[lr[i][1]-1]-ruisekiwa[lr[i][0]-1])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
lr = [list(map(int, input().split())) for _ in range(q)]

ruisekiwa=[0]*(n+1)
for i in range(n):
    if s[i]=="A" and s[i+1]=="C":
        ruisekiwa[i+1]=ruisekiwa[i]+1
    else:
        ruisekiwa[i+1] = ruisekiwa[i]
for i in range(q):
    print(ruisekiwa[lr[i][1]-1]-ruisekiwa[lr[i][0]-1])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
lr = [list(map(int, input().split())) for _ in range(q)]

ruisekiwa=[0]*(n+1)
for i in range(n):
    if s[i]=="A" and s[i+1]=="C":
        ruisekiwa[i+1]=ruisekiwa[i]+1
    else:
        ruisekiwa[i+1] = ruisekiwa[i]
for i in range(q):
    print(ruisekiwa[lr[i][1]-1]-ruisekiwa[lr[i][0]-1])

Buggy submission (verdict: Runtime Error):
n=map(int,input().split())
s=input()
l1,r1=map(int,input().split())
l2,r2=map(int,input().split())
l3,r3=map(int,input().split())

s1=s[(l1-1):r1]
s2=s[(l2-1):r2]
s3=s[(l3-1):r3]

print(s1.count("AC"))
print(s2.count("AC"))
print(s3.count("AC"))
Problem p03106 (python)

Fixed submission:
a,b,k=map(int,input().split())
numlst=[]
for i in range(max(a,b)):
    if a%(i+1)==0 and b%(i+1)==0:
        numlst.append(i+1)

print(numlst[len(numlst)-k])

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
numlst=[]
for i in range(1,max(a,b)):
    if a%i==0 and b%i==0:
        numlst.append(i)

print(numlst[k-1])
Problem p03136 (python)

Fixed submission:
n=int(input())
listL = list(map(int, input().split()))
if max(listL)<(sum(listL)-max(listL)):
    print("Yes")
else:
    print("No")

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

listA=[]
for i in range(n):
    listA.append(list(map(int,input().split())))

for i in range(n):
    popped_item1=listA[i].pop(0)

listB=[]
for i in listA:
    for j in i:
        listB.append(j)

cnt=0
for i in range(m+1):
    if listB.count(i)==n:
        cnt+=1
print(cnt)
Problem p03212 (python)

Fixed submission:
from itertools import product
n=int(input())

ans = 0
for i in range(3, 10):
    for s in product('357', repeat=i):
        if len(set(s)) < 3:
            continue
        num = int(''.join(s))
        if  num > n:
            break
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import product
n=int(input())

ans = 0
for i in range(3, 10):
    for s in product('357', repeat=i):
        if len(set(s)) < 3:
            continue
        753num = int(''.join(s))
        if  753num> n:
            break
        ans += 1
print(ans)
Problem p03241 (python)

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

limit=int(m**(1/2))+1

divisors=[]
for d in range(1,limit):
    if m%d==0:
        divisors.append(d)
        divisors.append(m//d)

divisors.sort()
ans=1

for d in divisors:
    if n*d<=m:
        ans=d
print(ans)

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

limit=int(m**(1/2))+1

divisors=[]
for d in range(limit):
    if m%d==0:
        divisors.append(d)
        divisors.append(m//d)
ans=1

for d in divisors:
    if n*d<=m:
        ans=d
print(ans)
Problem p03260 (python)

Fixed submission:
a,b=map(int,input().split())
if a%2==1 and b%2==1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
if a%2==1 and b%2==1:
    print("Yes")
else:
    print("No")
Problem p03273 (python)

Fixed submission:
h,w=map(int,input().split())
a = [list(input()) for _ in range(h)]

row=[False]*h
col=[False]*w

for i in range(h):
    for j in range(w):
        if a[i][j]=="#":
            row[i]=True
            col[j]=True

for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j],end="")
        print()

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
a = [list(input()) for _ in range(w)]

row=[False]*h
col=[False]*w

for i in range(h):
    for j in range(w):
        if a[i][j]=="#":
            row[i]=True
            col[j]=True

for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j],end="")
        print()
Problem p03323 (python)

Fixed submission:
a,b=map(int,input().split())
if a+b<=16 and a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a+b<=16 and a<=8 and B<8:
    print("Yay!")
else:
    print(":(")
Problem p03369 (python)

Fixed submission:
s=input()
print(700+int(s.count("o")*100))

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

answer = 10**18
for c in range(2*10**6+1):
  a = X-c
  b = Y-c
  cost = C*c*2
  cost += max(a, 0)*A
  cost += max(b, 0)*B
  if answer > cost:
    answer = cost
print(answer)

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

answer = 10**18
for c in range(1.5*10**6+1):
  a = X-c
  b = Y-c
  cost = C*c*2
  cost += max(a, 0)*A
  cost += max(b, 0)*B
  if answer > cost:
    answer = cost
print(answer)
Problem p03437 (python)

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

if x% y == 0:
    print(-1)
else:
    print(x)

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

if yx% y == 0:
    print(-1)
else:
    print(x)
Problem p03523 (python)

Fixed submission:
s=input()
AKB={"AKIHABARA","KIHABARA","AKIHBARA","KIHBARA","AKIHABRA","KIHABRA","AKIHBRA","KIHBRA","AKIHABAR","KIHABAR","AKIHBAR","KIHBAR","AKIHABR","KIHABR","AKIHBR","KIHBR"}

print("YES" if s in AKB else "NO")

Buggy submission (verdict: Runtime Error):
s=input()
AKB={"AKIHABARA","KIHABARA","AKIHBARA","KIHBARA","AKIHABRA","KIHABRA","AKIHBRA","KIHBRA","AKIHABAR","KIHABAR","AKIHBAR","KIHBAR","AKIHABR","KIHABR","AKIHBR","KIHBR"}

print("YES" if s in pos else "NO")

Buggy submission (verdict: Runtime Error):
s=input()

flag=True
KIHBR="KIHBR"
s_new=s.replace("A", "")
if len(s_new)>5:
    flag=False
else:
    for i in range(5):
        if s_new[i]!=KIHBR[i]:
            flag=False
            break

if s.count("AA")>1 or s.count("KIH")!=1:
    flag=False

print("YES" if flag else "NO")

Buggy submission (verdict: Runtime Error):
s=input()

flag=True
KIHBR="KIHBR"
s_new=s.replace("A", "")
cnt=0
for i in range(len(s_new)):
    if s_new[i]!=KIHBR[cnt]:
        flag=False
        break
    cnt+=1

if len(s_new)>5:
    flag=False

if s.count("AA")>1:
    flag=False

print("YES" if flag else "NO")

Buggy submission (verdict: Runtime Error):
s=input()

flag=True
KIHBR="KIHBR"
s_new=s.replace("A", "")
cnt=0
for i in range(len(s_new)):
    if s_new[i]!=KIHBR[cnt]:
        flag=False
        break
    cnt+=1

if s.count("AA")>1:
    flag=False

print("YES" if flag else "NO")
Problem p03574 (python)

Fixed submission:
import itertools

h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]

for i in range(h):
    for j in range(w):
        cnt = 0
        if s[i][j] != "#":
            for dx, dy in itertools.product([-1, 0, 1], repeat=2):
                y = i+dy
                x = j+dx
                if y < 0 or y >= h:
                    continue
                if x < 0 or x >= w:
                    continue
                if s[y][x] == "#":
                    cnt += 1
            s[i][j] = str(cnt)

for i in range(h):
    print(''.join(s[i]))

Buggy submission (verdict: Runtime Error):
import itertools

h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]

for i in range(w):
    for j in range(h):
        cnt=0
        if s[i][j]!="#":
            for dx,dy in itertools.product([-1,0,1],repeat=2):
                x=i+dx
                y=j+dy
                if x<0 or x>=w:
                    continue
                if y<0 or y>=h:
                    continue
                if s[x][y]=="#":
                    cnt+=1
            s[i][j]=str(cnt)

for i in range(h):
    print(''.join(s[i]))
Problem p03575 (python)

Fixed submission:
n,m=map(int, input().split())
ab=[list(map(int, input().split())) for _ in range(m)]

from collections import deque

def bfs(u):
    queue = deque([u])
    d = [None] * n # uからの距離の初期化
    d[u] = 0 # 自分との距離は0
    while queue:
        v = queue.popleft()
        for i in graph[v]:
            if d[i] is None:
                d[i] = d[v] + 1
                queue.append(i)
    flag=True
    for _i in range(n):
        if d[_i]==None:
            flag=False
    return flag

cnt=0
for i in range(m):
    graph = [[] for _ in range(n)]
    for j in range(m):
        if i!=j:
            graph[ab[j][0]-1].append(ab[j][1]-1)
            graph[ab[j][1]-1].append(ab[j][0]-1)
    if not bfs(0):
        cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
from scipy.sparse.csgraph import dijkstra
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

graph = [[0]*(n+1) for _ in range(n+1)]
for a, b in ab:
    graph[a][b] = 1

ans = 0
inf = 10**9

for a, b in ab:
    graph[a][b] = inf
    dist = dijkstra(graph, indices = a, directed = False)
    if dist[b] >= inf:
        ans += 1
    graph[a][b] = 1

print(ans)

Buggy submission (verdict: Runtime Error):
from scipy.sparse.csgraph import dijkstra
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

graph = [[0]*(n+1) for _ in range(n+1)]
for a, b in ab:
    graph[a-1][b-1] = 1

ans = 0
inf = 10**9

for a, b in ab:
    graph[a][b] = inf
    dist = dijkstra(graph, indices = a, directed = False)
    if dist[b] >= inf:
        ans += 1
    graph[a][b] = 1

print(ans)
Problem p03856 (python)

Fixed submission:
s=input()
s=s.replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","")
if s:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
s=input()
s＝s.replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","")
if s:
    print("NO")
else:
    print("YES")
Problem p04020 (python)

Fixed submission:
n=int(input())
a=[int(input()) for _ in range(n)]

if a.count(0)==0:
    print(sum(a)//2)
else:
    tmp_sum=0
    ans=0
    for i in range(n):
        if a[i]==0:
            ans+=tmp_sum//2
            tmp_sum=0
        else:
            tmp_sum+=a[i]
    ans+=tmp_sum//2

    print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[int(input()) for _ in range(n)]

if a.count(0)==0:
    print(sum(a//2))
else:
    tmp_sum=0
    ans=0
    for i in range(n):
        if a[i]==0:
            ans+=tmp_sum//2
            tmp_sum=0
        else:
            tmp_sum+=a[i]
    ans+=tmp_sum//2

    print(ans)
Problem p02642 (python)

Fixed submission:
import bisect

n = int(input())
a = list(map(int, input().split()))
a.sort()
k = len(a)
ok = [0] * k
for i in range(k):
    if i < k - 1 and a[i] == a[i + 1]:
        ok[i] = 1
        ok[i + 1] = 1
        continue
    if a[i] < 2 * 100:
        for j in range(i + 1, k):
            if a[j] % a[i] == 0:
                ok[j] = 1
    else:
        times = 2
        while a[i] * times < a[-1]:
            l = bisect.bisect_left(a, a[i] * times)
            r = bisect.bisect_right(a, a[i] * times)
            if r != l:
                for idx in range(l, r):
                    ok[idx] = 1
            times += 1
# print(ok)
print(len([i for i in ok if i == 0]))
# print(ok) WAはどこ？

Buggy submission (verdict: Runtime Error):
import bisect

n = int(input())
a = list(map(int, input().split()))
a.sort()
k = len(a)
ok = [0] * k
for i in range(k):
    if i < k - 1 and a[i] == a[i + 1]:
        ok[i] = 1
        ok[i + 1] = 1
        continue
    """"if a[i] < 2 * 100:
        for j in range(i + 1, k):
            if a[j] % a[i] == 0:
                ok[j] = 1"""
    else:
        times = 2
        while a[i] * times < a[-1]:
            l = bisect.bisect_left(a, a[i] * times)
            r = bisect.bisect_right(a, a[i] * times)
            if r != l:
                for idx in range(l, r):
                    ok[idx] = 1
            times += 1
# print(ok)
print(len([i for i in ok if i == 0]))
# print(ok) WAはどこ？
Problem p02691 (python)

Fixed submission:
#!/usr/bin/env python3
import bisect

n = int(input())
a = list(map(int, input().split()))
# b = a -1 とすると、bi+bj = -2*i or -2+j となるi,jを見つける
# sortして2分探索すると解ける
b = [a[i] - (1 + i) for i in range(0, n)]
b, idx = zip(*sorted(zip(b, range(1, n + 1))))
# print(b)
ans = 0
for i in range(n):
    # b[i]を固定して二分探索
    r = bisect.bisect_right(b, -b[i] - 2 * idx[i])
    l = bisect.bisect_left(b, -b[i] - 2 * idx[i])
    ans += r - l
    # if r - l != 0:
    # print(i, r, l, -b[i] - 2 * idx[i])
print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
n, m = map(int, input().split())
h = list(map(int, input().split()))
not_good = []
for i in range(m):
    a, b = map(int, input().split())
    if h[a - 1] > h[b - 1]:  # bはダメ
        not_good.append(b)
    elif h[a - 1] == h[b - 1]:
        not_good.append(a)
        not_good.append(b)
    else:
        not_good.append(a)
ans = 0
not_good = list(set(not_good))
not_good.sort()
# print(not_good)
idx = 0
for i in range(1, n + 1):
    if i < not_good[idx]:
        ans += 1
        # print(i, end=" ")
    elif i == not_good[idx]:
        idx += 1
        if idx == len(not_good):
            ans += n - i
            break
    else:
        pass
print(ans)
Problem p02727 (python)

Fixed submission:
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:]
z.extend(q[-y:])
z.extend(r)
z.sort()
#print(z)
print(sum(z[-x-y:]))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:].extend(q[-y:]).extend(r)
z.sort()
print(sum(z[-x-y:]))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:].extend(q[-y:]).extend(r)
z.sort()
print(sum(z[-x-y]))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
z = p[-x:].extend(q[-y:]).extend(r)
z.sort()
print(sum(z[-x-y]))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
r.sort()
ans = sum(p[-x:])+sum(q[-y:])
x_pos = -x
y_pos = -y
for i in range(c):
    #したから見ていく
    if min(p[x_pos],q[y_pos]) >= r[i]:
        continue
    elif p[x_pos] > q[y_pos]:
        ans += r[i] - q[y_pos]
        y_pos -= 1
    else:
        ans += r[i] - p[x_pos]
        x_pos -= 1
    if x_pos == -a:
        p.insert(0,10**5)
    if y_pos == -b:
        q.insert(0,10**5)
print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
r.sort()
ans = sum(p[-x:])+sum(q[-y:])
x_pos = -x
y_pos = -y
for i in range(c):
    #したから見ていく
    if min(p[x_pos],q[y_pos]) >= r[i]:
        continue
    elif p[x_pos] > q[y_pos]:
        ans += r[i] - q[y_pos]
        y_pos -= 1
    else:
        ans += r[i] - p[x_pos]
        x_pos -= 1
    if x_pos == -a:
        p.insert(0,10**5)
        x_pos -= 1
    if y_pos == -b:
        q.insert(0,10**5)
        y_pos -=1
print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
r.sort()
ans = sum(p[-x:])+sum(q[-y:])
x_pos = -x
y_pos = -y
for i in range(c):
    #したから見ていく
    if min(p[x_pos],q[y_pos]) >= r[i]:
        continue
    elif p[x_pos] > q[y_pos]:
        ans += r[i] - q[y_pos]
        y_pos -= 1
    else:
        ans += r[i] - p[x_pos]
        x_pos -= 1
print(ans)
Problem p02748 (python)

Fixed submission:
#!/usr/bin/env python3
a,b,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a_idx = a.index(min(a))
b_idx = b.index(min(b))
#print(a_idx,b_idx)

ans = min(a)+min(b)
for i in range(m):
    x,y,c = map(int,input().split())
    if x-1 != a_idx or y-1 != b_idx:
        ans = min(ans,a[x-1]+b[y-1]-c)
    if x-1 == a_idx and y-1 == b_idx:
        ans = min(ans,a[x-1]+b[y-1]-c)
print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
a,b,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a_idx = a.index(min(a))
b_idx = b.index(min(b))
#print(a_idx,b_idx)

ans = min(a)+min(b)
for i in range(m):
    x,y,c = map(int,input().split())
    if x-1 != a_idx or y-1 != b_idx:
        ans = min(ans,a[x-1]+b[x-1]-c)
    if x-1 == a_idx and y-1 == b_idx:
        ans = min(ans,a[x-1]+b[x-1]-c)
print(ans)
Problem p02761 (python)

Fixed submission:
#!/usr/bin/env python3
n,m = map(int,input().split())
digit = [-1]*3
for i in range(m):
    s,c =map(int,input().split())
    if digit[s-1] == -1: digit[s-1] = c
    elif digit[s-1] != c: 
        print(-1)
        exit()
if digit[0] == 0 and n != 1:
    print(-1)
    exit()
if (digit[0] == 0 and n == 1) or (n == 1 and m == 0):
    print(0)
    exit()
for i in range(n):
    if digit[i] == -1:
        print(max(1-i,0),end="")
    else: print(digit[i],end="")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
n,m = map(int,input().split())
s = [0]*n
c = [0]*n
digit = [-1]*3
for i in range(m):
    s[i],c[i] =map(int,input().split())
    if digit[s[i]-1] == -1: digit[s[i]-1] = c[i]
    elif digit[s[i]-1] != c[i]: 
        print(-1)
        exit()
if digit[0] == 0:
    print(-1)
    exit()
for i in range(3):
    if digit[i] == -1:
        print(max(1-i,0),end="")
    else: print(digit[i],end="")
Problem p02784 (python)

Fixed submission:
#!/usr/bin/env python3

h,n = map(int,input().split())
a = list(map(int,input().split()))
print('Yes' if sum(a) >= h else "No")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

h,n = map(int,input().split())
a = list(map(int,input().split()))
print("Yes" else "No" if sum(a) >= h)
Problem p02845 (python)

Fixed submission:
#!/usr/bin/env pytho3
n = int(input())
a = list(map(int,input().split()))
# ３種類の値をもち、自分より前に同じ色の人がa[i]となる組み合わせ
# コーナーケースとして、全部同じ色なら3通り、あとは*6したらいい
# n<=10**5
# 先頭を色１、次にa[i] == 0になった点を色2,3にしてしていい。前から埋める
# 前から見ていって、それぞれの色の今の人数をcolorとして
# color.count(a[i]) == 2　ならans *= 2, ==3 ans *= 3
# 2ケースのみRE
mod = 10**9 + 7
if a == list(range(n)): print(3)
else:
  k = 0
  ans = 6
  color = [0,0,0]
  for person in range(n):
    #print(color,person)
    bit = 0#すでにcolor == a[i]が出てきているか?
    if a[person] == 0:
      if k == 3:#REになるケース
        print(0)
        exit()
      color[k] = 1
      k += 1
      continue
    for num in range(3):
      if color[num] == a[person]:
        bit += 1
        if bit == 1:
          color[num] += 1
      if num == 2: 
        ans *= bit
        ans = ans % mod
  print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env pytho3
n = int(input())
a = list(map(int,input().split()))
# ３種類の値をもち、自分より前に同じ色の人がa[i]となる組み合わせ
# コーナーケースとして、全部同じ色なら3通り、あとは*6したらいい
# n<=10**5
# 先頭を色１、次にa[i] == 0になった点を色2,3にしてしていい。前から埋める
# 前から見ていって、それぞれの色の今の人数をcolorとして
# color.count(a[i]) == 2　ならans *= 2, ==3 ans *= 3
mod = 10**9 + 7
if a == list(range(n)): print(3)
else:
  k = 0
  ans = 6
  color = [0,0,0]
  for person in range(n):
    #print(color,person)
    bit = 0#すでにcolor == a[i]が出てきているか?
    if a[person] == 0:
      color[k] = 1
      k += 1
      continue
    for num in range(3):
      if color[num] == a[person]:
        bit += 1
        if bit == 1:
          color[num] += 1
      if num == 2: 
        ans *= bit
        ans = ans % mod
  print(ans)
Problem p02882 (python)

Fixed submission:
#!/usr/bin/env python3
#input
import math
# math.degrees(theta) = theta radian to kodo
# math.atan(math.tan(theta)) = theta
a,b,x = map(int,input().split())
if x <= a*a*b/2:
    tan = (a*b*b)/(2*x)
else:
    tan = 2*(a*a*b-x)/(a**3)
print(math.degrees(math.atan(tan)))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
#input
import math
# math.degrees(theta) = theta radian to kodo
# math.atan(math.tan(theta)) = theta
a,b,x = map(int,input().split())
if x <= a*a*b/2:
    tan = 2*x/(a*b*b)
else:
    tan = (a**3)/2*(a*a*b-x)
print(math.degrees(math.atan(1/tan)))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
#input
import math
# math.degrees(theta) = theta radian to kodo
# math.atan(math.tan(theta)) = theta
a,b,x = map(int,input().split())
if x <= a*a*b/2:
    tan = 2*x/(a*b*b)
else:
    tan = (a**3)/2*(a*a*b-x)
print(math.degrees(math.atan(1/tan)))

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(int,input().split())
if a*a*b/2 <x:
    #台形のパターン
    tan = (a*a*a)/(-2*x+2*b*a*a)
    print(math.atan(tan))
else:
    tan = 2*x/(a*b*b)
    print(math.atan(tan))
Problem p02972 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
m = 0
res = []
# 1 idx
for i in range(n, 0, -1):
    # i の倍数でbit立っているものの個数を数える
    cnt = 0
    idx = 2
    while i * idx <= n:
        if ans[i * idx - 1]:
            cnt += 1
        idx += 1
    debug = cnt
    if cnt % 2 != a[i - 1]:
        ans[i - 1] = 1
        m += 1
        res.append(i)
print(m)
if m:
    print(*res)

Buggy submission (verdict: Runtime Error):
zn = int(input())
a = list(map(int, input().split()))
ans = [0] * n
m = 0
res = []
# 1 idx
for i in range(n, 0, -1):
    # i の倍数でbit立っているものの個数を数える
    cnt = 0
    idx = 2
    while i * idx <= n:
        if ans[i * idx - 1]:
            cnt += 1
        idx += 1
    debug = cnt
    if cnt % 2 != a[i - 1]:
        ans[i - 1] = 1
        m += 1
        res.append(i)
print(m)
if m:
    print(*res)
Problem p03059 (python)

Fixed submission:
# T/A * B を出力する
a,b,t = map(int,input().split())
print(b*(t//a))

Buggy submission (verdict: Runtime Error):
a,b,c= map(int,input().split())
pritn((c//a)*b)
Problem p03068 (python)

Fixed submission:
#!/usr/bin/env python3
n = int(input())
a = input()
k = int(input())
for i in range(n):
    if a[k-1] == a[i]: print(a[i],end="")
    else: print("*",end="")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
for i in range(n):
  if a[k-1] == a[i]: print(a[i],end="")
  else: print("*",end="")
Problem p03085 (python)

Fixed submission:
b = input()
if b == "A":
  print("T")
elif b == "C":
  print("G")
elif b == "T":
  print("A")
elif b == "G":
  print("C")

Buggy submission (verdict: Runtime Error):
b = input()
if b == "A":
  print("C")
elif b == "C":
  print("A"):
elif b == "T":
  print("G"):
elif b == "G":
  print("T"):

Buggy submission (verdict: Runtime Error):
b = input()
if b == "A":
  print("C")
elif b == "C":
  print("A"):
elif b == "T":
  print("G"):
elif b == "G":
  print("T"):
Problem p03102 (python)

Fixed submission:
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
a = []
for i in range(n):
    a.append(list(map(int,input().split())))
cnt = 0
for i in range(n):
    mat = 0
    for j in range(m):
        mat += a[i][j]*b[j]
    if mat + c > 0: cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,m,c = map(int,input().split())
b = np.array(list(map(int,input().split())))
a = []
for i in range(n):
    a.append(list(map(int,input().split())))
a = np.array(a)
ans = list(a @ b)
cnt = 0
for i in range(n):
    if ans[i] + c > 0: cnt += 1
print(cnt)