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

Fixed submission:
import sys 
X,Y = map(int, input().split())
for i in range(X+1):
    for j in range(X+1):
        if (((2*i) + (4*j)) == Y) or (((2*j) + (4*i)) == Y):
            if (i+j == X):
                print("Yes")
                sys.exit()
print("No")

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

for i in range(X+1):
    for j in range(X+1):
        if int(i) + int(j) < X+1:
            if (((2*i) + (3*j)) == Y) or (((2*j) + (3*i)) == Y):
                print("Yes")
                sys.exit()

print("No")
Problem p02646 (python)

Fixed submission:
import sys
A,V = map(int, input().split())
B,W = map(int, input().split())
T = int(input())

#これO(1)で解けそう。

# スピードが同じ or 逃げる方のスピードが速いと無理
if V <= W:
    print("NO")
    sys.exit()



# 鬼の方がスピードが速い場合で場合訳
distance_AB = abs(A-B)
speed_AB = abs(V-W)

if speed_AB * T >= distance_AB:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import sys
A,V = map(int(input()))
B,W = map(int(input()))
T = int(input())

#これO(1)で解けそう。

# スピードが同じ or 逃げる方のスピードが速いと無理
if V == W:
    print("NO")
    sys.exit()
elif W < V:
    print("YES")
    sys.exit()


# 鬼の方がスピードが速い場合で場合訳
distance_AB = abs(A-B)
speed_AB = abs(V-W)

if speed_AB * T < distance_AB:
    print("YES")
else:
    print("NO")
Problem p02657 (python)

Fixed submission:
N, M = map(int, input().split())
print(N*M)

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
A = list(map(int, input().split()))
 
ans = 1

if A.count(0) != 0:
    print(0)
    sys.exit()

for i in A:

    ans = ans*i
    if ans > int(10**18):
        print(-1)
        sys.exit()
 
if ans > int(10**18):
    print(-1)
else:
    print(ans)
Problem p02677 (python)

Fixed submission:
a,b,h,m=map(int,input().split())
import math
mm=m*6
hh=(h*60+m)/2
ans=a**2+b**2-2*a*b*math.cos(math.radians(abs(hh-mm)))
print(math.sqrt(ans))

Buggy submission (verdict: Runtime Error):
時針と分針の回り方も存じ上げないカス。
Problem p02713 (python)

Fixed submission:
from math import gcd
K = int(input())

ans =  0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans = ans + gcd(gcd(i,j),k)

print(ans)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
K = int(input())

ans =  0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans = ans + gcd(i,j,k)

print(ans)
Problem p02717 (python)

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

print(str(Z) + " " + str(X) + " " + str(Y))

Buggy submission (verdict: Runtime Error):
import sys
N,M = map(int, input().split())
A = list(map(int, input().split()))
sorted_A = sorted(A, reverse=True) 
all_A = sum(A)

rule = (1/(4*M))

ans = 0

for i in A:
    if (i / all_A) > rule:
        ans = ans + 1
    else:
        pass

if ans >= M:
    print("Yes")
else:
    print("No")
Problem p02755 (python)

Fixed submission:
import sys

a, b = [int(w) for w in input().split()]

max_n = (b + 1) * 10

for i in range(max_n):
    if a == int(i * 0.08) and b == int(i * 0.1):
        print(i)
        sys.exit()

print(-1)

Buggy submission (verdict: Runtime Error):
import math
A,B = map(int, input().split())

 

 
for i in range(1,100001):
    if A == int(i * 0.08) and B == int(i * 0.1):
        print(i)
        sys.exit()
 
print(-1)
Problem p02761 (python)

Fixed submission:
import sys
N, M = map(int, input().split())

#とりまぶっこむ 
SClis = [] 
for _ in range(M):
    a, b = map(int, input().split())
    SClis.append([a,b])

ans = [-1]*N

for i in range(M):
    singlelis = SClis[i]
    S =  (singlelis[0] - 1)
    C =  (singlelis[1])
    
    if ans[S] != -1 and ans[S] != C:
        print(-1)
        sys.exit()
    else:
        ans[S] = C


    
if N == 1:
    if ans[0] == -1:
        ans[0] = 0
        print(''.join(map(str, ans)))
        sys.exit()

if N != 1:
    if ans[0] == 0:
        print(-1)
        sys.exit()
    
    if ans[0] == -1:
        ans[0] = 1
    
    for i in range(1,N):
        if ans[i] == -1:
            ans[i] = 0

print(''.join(map(str, ans)))

Buggy submission (verdict: Runtime Error):
import sys
N, M = map(int, input().split())

SClis = [] 
for _ in range(M):
    a, b = map(int, input().split())
    SClis.append([a,b])

ans = [-1]*N


for singlelis in SClis:
    digits = singlelis[0]-1
    number = singlelis[1]

    if ans[digits] == -1 or ans[digits] == number:
        ans[digits] = number
    else:
        print(-1)
        sys.exit()

if ans[0] == 0:
    print(-1)
    sys.exit()


kotae = ""
for i in range(N):
    i_str = str(ans[i])

    if i == 0 and i_str == "-1":
        kotae = kotae + "1"
        

    if i_str == "-1" and i != 0:
        kotae = kotae + "0"
    elif i_str != "-1" and i != 0:
        kotae = kotae + i_str

print(int(kotae))
Problem p02795 (python)

Fixed submission:
H = int(input())
W = int(input())
N = int(input())

if H <= W:
    if N % W == 0:
        print(int(N/W))
    else:
        print(int((N//W) + 1))
else:
    if N % H == 0:
        print(int(N/H))
    else:
        print(int((N//H) + 1))

Buggy submission (verdict: Runtime Error):
H = int(input())
W = int(input())
N = int(input())

if H <= W:
    if N % W == 0:
        print(N/W)
    else:
        print((N//W) + 1)
else:
    if N % H == 0:
        print(int(N/H)
    else:
        print(int((N//H) + 1))
Problem p02841 (python)

Fixed submission:
M1,D1= map(int, input().split())
M2,D2 = map(int, input().split())

if D1 + 1 == D2:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
import sys
import math

N = input()

if int(N) <= 100:
    print("0")
    sys.exit()

if int(N) % 100 == 0:
    print("1")
    sys.exit()

tmp = (int(N) - (int(N)//100)*100)

if tmp <= 5:
    print("1")
    sys.exit()

tmp2 = math.ceil(tmp/5)

if int(N) <= tmp2*105:
    print("0")
else:
    print("1")

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

a = N/1.08

a1 = round(a)

a2 = int(a1*1.08)

if a2 == N:
    print(a1)
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
N=1079

a = N/1.08

a1 = round(a)

a2 = int(a1*1.08)

if a2 == N:
    print(a1)
else:
    print(:()
Problem p02842 (python)

Fixed submission:
import math
import sys
N = int(input())

for i in range(1,50001):
    if math.floor(i * 1.08) == N:
        print(i)
        sys.exit()

print(":(")

Buggy submission (verdict: Runtime Error):
N=1079

a = N/1.08

a1 = round(a)

a2 = int(a1*1.08)

if a2 == N:
    print(a1)
else:
    print(:()

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

a = N/1.08

a1 = round(a)

a2 = int(a1*1.08)

if a2 == N:
    print(a1)
else:
    print(:()
Problem p02853 (python)

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

trd = 100000
srd = 200000
onrd = 300000

if X == 3 and 3 < Y:
    print(trd)
elif X == 2 and 3 < Y:
    print(srd)
elif X == 1 and 3 < Y:
    print(onrd)
elif Y == 3 and 3 < X:
    print(trd)
elif Y == 2 and 3 < X:
    print(srd)  
elif Y == 1 and 3 < X:
    print(onrd)
elif X == 3 and Y == 3:
    print((trd)+(trd))
elif X == 3 and Y == 2:
    print((trd) +(srd))
elif X == 3 and Y == 1:
    print((trd)+(onrd))
elif X == 2 and Y == 3:
    print((srd)+(trd))
elif X == 2 and Y == 2:
    print((srd)+(srd))
elif X == 2 and Y == 1:
    print((srd)+(onrd))
elif X == 1 and Y == 3:
    print((onrd)+(trd))
elif X == 1 and Y == 2:
    print((onrd) + (srd))
elif X == 1 and Y == 1:
    print((onrd)+(onrd) + 400000)
else:
    print(0)

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

ans = float('inf') 
sum_A = sum(A)
CumSum = 0


for i in range(N-1):
  CumSum = CumSum + A[i]
  ans = min(ans,(abs((sum_A - CumSum)-(CumSum))))

print(ans)

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

3rd = 100000
2rd = 200000
1rd = 300000

if X == 3 and 3 < Y:
    print(3rd)
elif X == 2 and 3 < Y:
    print(2rd)
elif X == 1 and 3 < Y:
    print(1rd)
elif Y == 3 and 3 < X:
    print(3rd)
elif Y == 2 and 3 < X:
    print(2rd)  
elif Y == 1 and 3 < X:
    print(1rd)
elif X == 3 and Y == 3:
    print((3rd)+(3rd))
elif X == 3 and Y == 2:
    print((3rd) +(2rd))
elif X == 3 and Y == 1:
    print((3rd)+(1rd))
elif X == 2 and Y == 3:
    print((2rd)+(3rd))
elif X == 2 and Y == 2:
    print((2rd)+(2rd))
elif X == 2 and Y == 1:
    print((2rd)+(1rd))
elif X == 1 and Y == 3:
    print((1rd)+(3rd))
elif X == 1 and Y == 2:
    print((1rd) + (2rd))
elif X == 1 and Y == 1:
    print((1rd)+(1rd) + 400000)
else:
    print(0)
Problem p02854 (python)

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

ans = float('inf')
sum_A = sum(A)
hoge = 0


for i in range(N-1):
  hoge = hoge + A[i]
  ans = min(ans,abs(sum_A - (hoge*2)))

print(ans)

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

ans = 10**8 
sum_A = sum(A)
t = 0


for i in range(N-1):
  hoge = hoge + A[i]
  ans = min(ans,abs(sum_A - (hoge*2)))

print(ans)

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

ans = 10**8 
sum_A = sum(A)
hoge = 0


for i in range(N-1):
  CumSum = CumSum + A[i]
  ans = min(ans,(abs((sum_A - hoge)-(hoge))))

print(ans)

Buggy submission (verdict: Runtime Error):
FUCKOFF
Problem p02885 (python)

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

#隠される範囲
B_2 = B*2

if A - B_2 >= 0:
    print(A - B_2)
else:
    print(0)

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

#隠される範囲
C = (B*2)
D = A-C

if D = 0:
    print(0)
else:
    print(D)

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

#隠される範囲
C = (A-(B*2))

if C = 0:
    print(0)
else:
    print(C)
Problem p02899 (python)

Fixed submission:
n = int(input())
student = list(map(int,input().split()))
 
ans = [0] * n   #登校した順番を記録するためのリスト
 
for i in range(n):
    s = student[i]   #出席番号iの生徒が登校した順番をメモ
    ans[s-1] = i+1    #ansに出席番号を書き込む
 
print(*ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
student = list(map(int,input().split()))
 
ans = [0] * n   #登校した順番を記録するためのリスト
 
for i in range(n):
    s = student[i]   #出席番号がiの人が来た時に、既にs人いました。
    ans[s-1] = i+1 　#なのでansリスト(来た順に対応させる)のs-1番目(リストの仕様)に出席番号iの人が配属されます。

print(*ans)
Problem p02921 (python)

Fixed submission:
S = input()
T = input()

cnt = 0

for i in range(len(S)):
    if S [i] == T[i]:
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
print((n-1)*n//2)
Problem p02923 (python)

Fixed submission:
n=int(input())
h=[int(i) for i in input().split()]
c=0
d=c
for i in range(n-1):
    if h[i]>=h[i+1]:
        c+=1
    else:
        d=max([c,d])
        c=0

print(max([c,d]))

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
H = list(map(int, input().split()))
ans_lis = []
ans = 0
for i in range(N):
    for j in range(i,N-1):
        if H[j] >= H[j+1]:
            ans = ans + 1
        else:
            ans_lis.append(ans)
            ans = 0
print(max(ans_lis))
Problem p02934 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
ans = 0
 
for i in range(N):
    ans = ans + 1 / A[i]
 
ans = 1 / ans 
 
print(ans)

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

A = [int(input()) for b in range(N)]
Ans = 0

for i in range(N):
    v += 1 / a[i]
print(1 / Ans)

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

A = [int(input()) for _ in range(N)]
Ans = 0

for i in range(N):
    v += 1 / a[i]
print(1 / Ans)

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

A = list(map(int, input().split()))
Ans = 0

for i in range(N):
    v += 1 / a[i]
print(1 / Ans)
Problem p02945 (python)

Fixed submission:
A, B = map(int, input().split())
 
C = A+B
D = A-B
E = A*B
 
LIST = [C,D,E]
 
print(max(LIST))

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

A-B = b-a
A-C = c-a
A-D = d-a
A-E = e-a
B-C = c-b
B-D = d-b
B-E = e-b
C-D = d-c
C-E = e-c
D-E = e-d

if (A-B > k) or (A-C > k) or (A-D > k) or (A-E > k) or (B-C > k) or (B-E > k) or (C-D > k) or (C-E > k) or (D-E > k):
    print(":(")
else:
    print("Yay!")

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

C = print(A+B)
D = print(A-B)
E = print(A*B)

LIST = [C,D,E]

print(max(LIST))

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

C = print(A+B)
D = print(A-B)
E = print(A*B)

print(max(C,D,E))

Buggy submission (verdict: Runtime Error):
import numpy
A, B = map(int, input().split())

C = print(A+B)
D = print(A-B)
E = print(A*B)

if C > D and C > E:
    print(C) 
elif D > C and D > E:
    print(D)
elif E > C and E > D:
    print(E)

Buggy submission (verdict: Runtime Error):
import numpy
A, B = map(int, input().split())

C = print(A + B)
D = print(A - B)
E = print(A*B)

if C > D and C > E:
    print(C) 
elif D > C and D > E:
    print(D)
elif E > C and E > D:
    print(E)

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

AprasuB = print(A + B)
AmainasuB = print(A - B)
AkakeruB = print(A*B)

if AmainasuB > AprasuB and AmainasuB > AkakeruB:
    print(AmainasuB) 
elif AprasuB > AmainasuB and AprasuB > AkakeruB:
    print(AprasuB)
elif AkakeruB > AmainasuB and AkakeruB > AprasuB:
    print(AkakeruB)
Problem p02952 (python)

Fixed submission:
N = int(input())
ans = 0

#Pythonのfor文range()の右側<最大値>は書いている値から-1されるものなので、注意する。(+1する)

for i in range(1, N + 1):

    if len(str(i)) % 2 == 1:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0

#Pythonのfor文range()の右側<最大値>は書いている値から-1されるものなので、注意する。(+1する)

for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
    ans += 1

print(ans)
Problem p02957 (python)

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

 
if (a+b)%2==0:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
#もし最初に与えられていたリストが昇順(done)

#1番目とn番目の文字列を消去したリストを作成する。そのリストが昇順ならまずは第一段階クリア
#そして最初に与えられた文字のリストで、(<一番最後の文字> - <一番最初の文字>　+1)なら成立する。

#実装すれば、勝ちなはず。

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



#初期リストを昇順に(done)
ascending_order = P.sort()



#1番目と一番最後を削除したリスト
Test_P = P[1:N-1]

#TestPの昇順
ascending_TestP = Test_P.sort()

Check = (abs((P[-1] + P[0]) +1)) 

if P == ascending_order:
    print("YES")
elif Test_P != ascending_TestP:
    print("NO")
else:
    print("YES")
Problem p02958 (python)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
z = 0
for i in range(n):
  if p[i] != i + 1:
    z += 1
if z <= 2:
  print('YES')
else:
  print('NO')

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

ans = 0

for i in range(n):
  if P[i] != i + 1:
    ans += 1
if ans <= 2:
  print('YES')
else:
  print('NO')
Problem p02981 (python)

Fixed submission:
N,A,B = map(int,input().split())

#電車の時
TRAIN = N*A

TAXI = B

if TRAIN > TAXI:
    print(TAXI)
else:
    print(TRAIN)

Buggy submission (verdict: Runtime Error):
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((i*j)%2019)
    sys.exit()

ans = 4000

for i in range(L,R):
    for j in range(i+1,R):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)
Problem p02982 (python)

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




def dst(i, j):
    a = pnt[i]
    b = pnt[j]
    ret = 0
    for p, q in zip(a, b):
        ret += (p - q) ** 2
    r = ((ret ** (0.5)))

    return r


ans = 0
for i in range(n):
    for j in range(i + 1, n):
        tmp = dst(i, j)
        if tmp == int(tmp):
            ans = ans + 1 

print(ans)

Buggy submission (verdict: Runtime Error):
b
Problem p02983 (python)

Fixed submission:
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((R*L)%2019)
    sys.exit()

ans = 4000

for i in range(L,R):
    for j in range(i+1,R+1):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)

Buggy submission (verdict: Runtime Error):
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((i*j)%2019)
    sys.exit()

ans = 4000

for i in range(L,R):
    for j in range(i+1,R):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)

Buggy submission (verdict: Runtime Error):
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((i*j)%2019)
    sys.exit()

ans = 100*100

for i in range(L,R):
    for j in range(i+1,R):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)

Buggy submission (verdict: Runtime Error):
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((i*j)%2019)
    sys.exit()

ans = float('inf')

for i in range(L,R):
    for j in range(i+1,R):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)

Buggy submission (verdict: Runtime Error):
import sys 
L,R = map(int, input().split())

if R-L >= 2019:
    print(0)
    sys.exit()
elif R-L == 1:
    print((i*j)%2019)
    sys.exit()

ans = 10**1000

for i in range(L,R):
    for j in range(i+1,R):
        number = (i*j)%2019
        ans = min(ans,number)

print(ans)
Problem p02988 (python)

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

ans = 0

#+2まで考慮してるから、nの数を-2にして調整しろ
for i in range(n-2):
	if p[i] < p[i + 1] < p[i + 2] or p[i + 2] < p[i + 1] < p[i]:
		ans = ans + 1

print(ans)

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

ans = 0

#+2まで考慮してるから、nの数を-2にして調整しろ
for i in range(n):
	if p[i] < p[i + 1] < p[i + 2] or p[i + 2] < p[i + 1] < p[i]:
		ans = ans + 1

print(ans)
Problem p03030 (python)

Fixed submission:
n=int(input())
sp=[]
for i in range(n):
    s,p=input().split()
    sp.append([s,int(p),i+1])
sp.sort(key=lambda sp:(sp[0],-sp[1]))
for i in sp:print(i[2])

Buggy submission (verdict: Runtime Error):
a
Problem p03043 (python)

Fixed submission:
import math
N, K = map(int, input().split())
p = 0
for i in range(1,N+1):
  if i < K:
    times = math.ceil(math.log2(K/i))
    p = p + (1/N)*(1/2)**times
  else:
    p = p + (1/N)
print(p)

Buggy submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())

expo = (math.ceil(math.log(K,2)))

ans = 0
bunbo = 1/N
for i in range(N):
    ans = ans + (bunbo * (1/2)**expo)
    expo = expo - 1

print(ans)
Problem p03060 (python)

Fixed submission:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0

for i in range(N):
    if ((V[i]) - (C[i])) >= 0:
        ans = ans + ((V[i]) - (C[i]))

print(ans)

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

ans = 0

ALEN = (len(A))

B = list(A)



B_re =  list(reversed(B))

ans = 0


for i in range(ALEN):
    if B[i] != B_re[i]:
        ans = ans+1
    
if ans　% 2 == 0:
    print(ans//2)
elif ans %2 != 0:
    print((ans//2) +1)
elif ans == 0:
    print(0)
Problem p03067 (python)

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


#もし家1と家2までの距離
if A<C<B or B<C<A:
    print("Yes")
else:
    print("No")

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


if A<C<B or B<C<A
    print("Yes")
else:
    print("No")
Problem p03071 (python)

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

OnlyA = A+(A-1)

OnlyB = B+(B-1)

AaddB = A + B

print(max([OnlyA,OnlyB,AaddB]))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

OnlyA = A+(A-1)
 
OnlyB = B+(B-1)
 
AaddB = A + B
 
print(max([OnlyA,OnlyB,AaddB]))

Buggy submission (verdict: Runtime Error):
A,B= [int(input()) for i in range(2)]  
OnlyA = A+(A-1)

OnlyB = B+(B-1)

AaddB = A + B

print(max([OnlyA,OnlyB,AaddB]))

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

OnlyA = A+(A-1)

OnlyB = B+(B-1)

AaddB = A + B

print(max[OnlyA,OnlyB,AaddB])
Problem p03076 (python)

Fixed submission:
import itertools

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())



dish = [A,B,C,D,E]

combination = list(itertools.permutations(dish))

ans = []
count = 0

for i in combination:
    time = 0
    for j in i:
        if count != 4:
            time = time + j
            if time % 10 != 0:
                while time % 10 != 0:
                    time = time + 1
            count = count+1
        elif count == 4:
            time = time + j
            count = 0
            ans.append(time)

print(min(ans))

Buggy submission (verdict: Runtime Error):
a
Problem p03085 (python)

Fixed submission:
b = input()

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

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

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

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

if b==A:
    print("T")
elif b==T:
    print("C")
elif b==C:
    print("G")
elif b==G:
    print("C")
Problem p03086 (python)

Fixed submission:
S = input()
ACGT = ["A","C","G","T"]

ans = 0 
ans_lis = [0]

for i in range(len(S)):
    if S[i] in ACGT:
        ans = ans + 1 
        if i == (len(S)-1):
            ans_lis.append(ans)
    elif S[i] not in ACGT:
        ans_lis.append(ans)
        ans = 0 

print(max(ans_lis))

Buggy submission (verdict: Runtime Error):
S = input()
ans = 0 
ans_lis = [0]

for i in range(len(S)):
    if S[i] in ACGT:
        ans = ans + 1 
        if i == (len(S)-1):
            ans_lis.append(ans)
    else:
        ans_lis.append(ans)
        ans = 0 

print(max(ans_lis))

Buggy submission (verdict: Runtime Error):
S = input()
ans = 0 
ans_lis = [0]

for i in range(len(S)):
    if S[i] in "ACGT":
        ans = ans + 1
        if i == (len(S)-1):
            ans_lis.append(ans)
    elif S[i] not in ACGT:
        ans_lis.append(ans)
        ans = 0 

print(max(ans_lis))

Buggy submission (verdict: Runtime Error):
S = input()
ACGT = ["A","C","G","T"]

ans = 0 
ans_lis = []

for i in range(len(S)):
    if S[i] in ACGT:
        ans = ans + 1 
    elif S[i] not in ACGT:
        ans_lis.append(ans)
        ans = 0 

print(max(ans_lis))

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

len = 0

ans = []
for ch in S:
    if ch in 'ACGT':
        len = len +1
    else:
        ans.append(len)
        len = 0
        

if len(ans) == 0:
    print(0)
else:
    print(max(ans))

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

len = 0

ans = []
for ch in S:
    if ch in 'ACGT':
        len = len +1
    else:
        ans.append(len)
        len = 0
        
if len(ans) == 0:
    print(0)
else:
    max(ans)

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

len = 0

ans = []
for ch in S:
    if ch in 'ACGT':
        len = len +1
    else:
        ans.append(len)
        len = 0
        
print(max(ans))
Problem p03102 (python)

Fixed submission:
N,M,C = map(int, input().split())
B = list(map(int, input().split()))

ans = 0

for i in range(N):
    A = list(map(int, input().split()))
    check = C

    for i,j in zip(A,B):
        check = check + (i*j)

    if check > 0:
        ans = ans + 1

print(ans)

Buggy submission (verdict: Runtime Error):
a