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

Fixed submission:
from sys import stdin
N,M,X,Y=[int(x) for x in stdin.readline().rstrip().split()]
datax=[int(x) for x in stdin.readline().rstrip().split()]
datay=[int(x) for x in stdin.readline().rstrip().split()]
if sorted(datax)[-1]+1 <= sorted(datay)[0] and  X < sorted(datax)[-1]  and sorted(datay)[0] <=Y: 
    print("No War")
else:
    print("War")

Buggy submission (verdict: Runtime Error):
N,M,X,Y=[int(x) for x in stdin.readline().rstrip().split()]
datax=[int(x) for x in stdin.readline().rstrip().split()]
datay=[int(x) for x in stdin.readline().rstrip().split()]
if sorted(datax)[-1] < sorted(datay)[0]:
    print("No War")
else:
    print("War")
Problem p03273 (python)

Fixed submission:
import numpy as np
from sys import stdin
H,W=[int(x) for x in stdin.readline().rstrip().split()]
data=[]
for i in range(H):
    data.append([ 1 if x == "#" else 0 for x in list(input())])
data=np.array(data)
index_col=[]
for j in range(W):
    if sum(data[:,j]) == 0:
        index_col.append(j)
data=np.delete(data, index_col, 1)

index_row=[]
for k in range(H):
    if sum(data[k]) == 0:
        index_row.append(k)
data=np.delete(data,index_row,0)
for l in data:
    tmp=""
    for m in l:
        if m == 1:
            tmp=tmp+"#"
        else:
            tmp=tmp+"."
    print(tmp)

Buggy submission (verdict: Runtime Error):
import numpy as np
from sys import stdin
N,K=[int(x) for x in stdin.readline().rstrip().split()]
data=[]
for i in range(N):
    data.append([ 1 if x == "#" else 0 for x in list(input())])
data=np.array(data)
index_col=[]
for j in range(N):
    if sum(data[:,j]) == 0:
        index_col.append(j)
data=np.delete(data, index_col, 1)

index_row=[]
for k in range(K):
    if sum(data[k]) == 0:
        index_row.append(k)
data=np.delete(data,index_row,0)
for l in data:
    tmp=""
    for m in l:
        if m == 1:
            tmp=tmp+"#"
        else:
            tmp=tmp+"."
    print(tmp)
Problem p03282 (python)

Fixed submission:
from sys import stdin
S = (stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
cnt = 0
for i in S:
    if i == "1":
        cnt += 1
    else:
        ans = int(i)
        break
if cnt >= K:
    ans = 1
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
S = (stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
cnt = 0
for i in S:
    if i == "1":
        cnt += 1
    else:
        ans = int(i)
        break
if cnt == K:
    ans = 1
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
S = (stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
cnt = 0
for i in S:
    if i == "1":
        cnt += 1
    else:
        ans = i
if cnt == K:
    ans = 1
print(ans)
Problem p03303 (python)

Fixed submission:
from sys import stdin
moji=(stdin.readline().rstrip())
N=int(stdin.readline().rstrip())
ans=moji[0]
ite=len(moji)
for i in range(1,ite+1):
    if i*N > len(moji)-1:
        break
    ans=ans+moji[i*N]
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
moji=(stdin.readline().rstrip())
N=int(stdin.readline().rstrip())
ans=moji[0]
for i in range(1,len(moji)):
    if i*N > len(moji):
        break
    ans=ans+moji[i*N]
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
moji=stdin.readline().rstrip()
N=int(stdin.readline().rstrip())
ite=(len(moji)//N)
ans=moji[0]
for i in range(1,ite+1):
    ans=ans+moji[i*N]
print(ans)
Problem p03308 (python)

Fixed submission:
from sys import stdin
N=int(stdin.readline().rstrip())
data=[int(x) for x in stdin.readline().rstrip().split()]
data=sorted(data)
print(abs(data[0]-data[-1]))

Buggy submission (verdict: Runtime Error):
from sys import stdin
data=[int(x) for x in stdin.readline().rstrip().split()]
data=sorted(data)
print(abs(data[0]-data[-1])
Problem p03324 (python)

Fixed submission:
from sys import stdin
D,N=[int(x) for x in stdin.readline().rstrip().split()]
if N%100==0:
  ans=100**D*(N+1)
else:
  if D==0:
      ans=N
  else:
      ans=100**D*N
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
D,N=[int(x) for x in stdin.readline().rstrip().split()]
if N%100=0:
  ans=100**D*(N+1)
else:
  if D==0:
      ans=N
  else:
      ans=100**D*N
print(ans)
Problem p03363 (python)

Fixed submission:
import numpy as np
from sys import stdin
N=int(stdin.readline().rstrip())
data=[int(x) for x in stdin.readline().rstrip().split()]
res = np.cumsum(data)
res=np.insert(res,0,0)
cnt=1
ans=0
tmp=float("inf")
ite=np.append(sorted(res),float("inf"))
for j in ite:
    if j == tmp:
        cnt+=1
    else:
        ans=ans+((cnt*(cnt-1))/2)
        cnt=1
    tmp=j
print(int(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
from sys import stdin
N=int(stdin.readline().rstrip())
a=[]
for i in range(N):
    a.append([int(x) for x in stdin.readline().rstrip().split()])

res = np.cumsum(data)
res=np.insert(res,0,0)
ans=0
tmp=float("inf")
for i in sorted(res):
    if i == tmp:
        ans+=1
    tmp=i
print(ans)
Problem p03371 (python)

Fixed submission:
from sys import stdin
A,B,C,X,Y = [int(x) for x in stdin.readline().rstrip().split()]
ans = 10**9
for i in range(0,2*(max(X,Y)+1)):
    total = A*max((X-(i//2)),0) + B*max((Y-(i//2),0)) + i*C
    #print(total,i)
    if total > 0 and total < ans:
        ans = total
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
A,B,C,X,Y = [int(x) for x in stdin.readline().rstrip().split()]
if A + B <= 2*C:
    ans = A*X + B*Y
    
elif A > 2*C and B > 2*C:
    ans = C*2*max(X,Y)

elif A > B:
    ans = 2*C*X + B*max(Y-X,0)

elif B > A:
    ans = A*max(X-Y,0) + 2*C*Y

print(ans)
Problem p03386 (python)

Fixed submission:
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
ran = range(A,B+1)
for i in sorted(set(ran[:K])|set(ran[-K:])):
    print(i)

Buggy submission (verdict: Runtime Error):
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
lst = list(range(A,B+1))
for i in sorted(set(lst[:K]+lst[-K:])):
    print(i)

Buggy submission (verdict: Runtime Error):
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
lst = list(range(A,B+1))
for i in sorted(list(set(lst[:K]+lst[-K:]))):
    print(i)

Buggy submission (verdict: Runtime Error):
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
lst = list(range(A,B+1))
for i in sorted(list(set([:K]+[-K:]))):
    print(i)

Buggy submission (verdict: Runtime Error):
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
lst = list(range(A,B+1))
for i in lst[:K]:
    print(i)
for j in lst[-K:]:
    print(j)
Problem p03387 (python)

Fixed submission:
from sys import stdin
A,B,C = [int(x) for x in stdin.readline().rstrip().split()]
d = sorted([A,B,C])
 
a = A % 2
b = B % 2
c = C % 2
 
if a == b == c:
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2
    
elif a == b:
    A += 1
    B += 1
    d = sorted([A,B,C])
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2
    ans += 1
    
elif a == c:
    A += 1
    C += 1
    d = sorted([A,B,C])
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2
    ans += 1
 
elif c == b:
    B += 1
    C += 1
    d = sorted([A,B,C])
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2
    ans += 1
 
    
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
A,B,C = [int(x) for x in stdin.readline().rstrip().split()]
d = sorted([A,B,C])

a = A % 2
b = B % 2
c = C % 2

if a == b == c:
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2
    
elif a == b:
    A += 1
    B += 1
    d = sorted([A,B,C])
    ans += 1
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2
    
elif a == c:
    A += 1
    C += 1
    d = sorted([A,B,C])
    ans += 1
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2

elif c == b:
    A += 1
    C += 1
    d = sorted([A,B,C])
    ans += 1
    ans = ((d[2] - d[1]) + (d[2] -d[0])) // 2

print(ans)
Problem p03399 (python)

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
print(min(A+C,A+D,B+C,B+D))

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
D=int(input())
print(min(A+C,A+D,B+c,B+D))
Problem p03415 (python)

Fixed submission:
from sys import stdin
data = []
for _ in range(3):
    data.append(input())
ans = data[0][0] + data[1][1] + data[2][2]
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
data = []
for _ in range(N):
    data.append([int(x) for x in stdin.readline().rstrip().split()])
ans = str(data[0][0]) + str(data[1][1]) + str(data[2][2])
print(ans)
Problem p03423 (python)

Fixed submission:
N = int(input())
print(N//3)

Buggy submission (verdict: Runtime Error):
N = input()
print(N//3)
Problem p03455 (python)

Fixed submission:
from sys import stdin
a,b=[int(x) for x in stdin.readline().rstrip().split()]
if (a*b)%2==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
from sys import stdin
a,b=[int(x) for x in stdin.readline().rstrip().split()]
if (a*b)%2==0:
  print(Even)
else:
  print(Odd)
Problem p03469 (python)

Fixed submission:
from sys import stdin
S = (stdin.readline().rstrip())
S = "2018" + S[4:]
print(S)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N,Y = [int(x) for x in stdin.readline().rstrip().split()]
flag = False
for x in range(N+1):
    for y in range(N+1):
        z = N - x - y
        if Y == 10000 * x + 5000 * y + 1000 * z:
            flag = True
            break
    else:
        continue
    break
if flag:
    print(x,y,z)
else:
    print(-1,-1,-1)
Problem p03474 (python)

Fixed submission:
from sys import stdin
A,B=[int(x) for x in stdin.readline().rstrip().split()]
S=(stdin.readline().rstrip())
flag=True
if S[:A].isdecimal() != True:
    flag = False
elif S[A:A+1] != "-":
    flag = False
elif S[A+1:].isdecimal() != True:
    flag = False

if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A,B=[int(x) for x in stdin.readline().rstrip().split()]
S=(stdin.readline().rstrip())
flag=True
if S[:A].isdecimal() != True:
    flag = False
elif S[A:A+1] != "-":
    flag = False
elif S[A+1:].isdecimal() != True:
    flag = False

if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A,B=[int(x) for x in stdin.readline().rstrip().split()]
S=(stdin.readline().rstrip())
flag=True
if S[0:A].isdecimal() != True:
    flag = False
elif S[A:B] != "-":
    flag = False
elif S[B:].isdecimal() != True:
    flag = False

if flag:
    print("Yes")
else:
    print("No")
Problem p03486 (python)

Fixed submission:
from sys import stdin
s = "".join(sorted(list(stdin.readline().rstrip())))
t = "".join(reversed((sorted(list(stdin.readline().rstrip())))))
if s < t:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
from sys import stdin
s = "".join(sorted(list(stdin.readline().rstrip())))
t = "".join(reversed((sorted(list(stdin.readline().rstrip()))))
if s < t:
    print("Yes")
else:
    print("No")
Problem p03487 (python)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()]
data = sorted(data) + [0]

if N == 1 and data[0] == 1:
    print(0)

elif N == 1 and data[0] != 1:
    print(1)

else:
    ans = 0
    num = data[0]
    cnt = 0
    for i in range(N+1):
        if data[i] == num:
            cnt += 1
        else:
            if cnt < data[i-1]:
                ans += cnt
            else:
                ans += (cnt-data[i-1])
            cnt = 1
            num = data[i]
    print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()]
data = sorted(data) + [0]

if N == 1 and data[0] == 1:
    print(0)

elif N == 1 and data[0] != 1:
    print(1)

else:
    ans = 0
    num = data[0]
    cnt = 0
    for i in range(N+1):
        if data[i] == num:
            cnt += 1
        else:
            if cnt < data[i-1]:
                ans += cnt
            else:
                ans += (cnt-data[i-1])
            cnt = 1
            num = data[i]
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
data = [int(x) for x in stdin.readline().rstrip().split()]
data = sorted(data) + [0]

if N == 1 and data[0] == 1:
    print(0)

elif N == 1 and data[0] != 1:
    print(1)

else:
    ans = 0
    num = data[0]
    cnt = 0
    for i in range(N+1):
        if data[i] == num:
            cnt += 1
        else:
            ans += min(abs(cnt-num),cnt)
            cnt = 1
            num = data[i]
print(ans)
Problem p03501 (python)

Fixed submission:
from sys import stdin
N,A,B = [int(x) for x in stdin.readline().rstrip().split()]
print(min(A*N,B))

Buggy submission (verdict: Runtime Error):
# 1-index
from sys import stdin
import numpy as np
N,C = [int(x) for x in stdin.readline().rstrip().split()]
imos = [[0]*(10**5+2) for i in range(C+1)]
 
for i in range(N):
    s,t,c = [int(x) for x in stdin.readline().rstrip().split()]
    imos[c][s] += 1
    imos[c][t+1] -= 1
 
imos = np.array(imos)[:,:-1]
#print(np.cumsum(imos,axis=1))
ans = max(np.cumsum(imos,axis=1).sum(axis=0))
print(ans)
Problem p03502 (python)

Fixed submission:
from sys import stdin
N=(stdin.readline().rstrip())
if int(N) % sum(list(map(int,list(N)))) == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
from sys import stdin
N=(stdin.readline().rstrip())
if sum(list(map(int,list(N)))) % N == 0:
    print("Yes")
else:
    print("No")
Problem p03504 (python)

Fixed submission:
# 1-index
from sys import stdin
import numpy as np
N, C = [int(x) for x in stdin.readline().rstrip().split()]
imos = np.array([[0]*(10**5+1) for i in range(C+1)])

for i in range(N):
    s, t, c = [int(x) for x in stdin.readline().rstrip().split()]
    imos[c, s - 1:t] = 1

imos = np.array(imos)
# print(np.cumsum(imos,axis=1))
ans = max(imos.sum(axis=0))
print(ans)

Buggy submission (verdict: Runtime Error):
# 1-index
from sys import stdin
import numpy as np
N, C = [int(x) for x in stdin.readline().rstrip().split()]
imos = [[0]*(10**5+1) for i in range(C+1)]

for i in range(N):
    s, t, c = [int(x) for x in stdin.readline().rstrip().split()]
    imos[c][s] += 1
    if t <= 10**5:
        imos[c][t+1] -= 1

imos = np.array(imos)
# print(np.cumsum(imos,axis=1))
ans = max(np.cumsum(imos, axis=1).sum(axis=0))
print(ans)

Buggy submission (verdict: Runtime Error):
# 1-index
from sys import stdin
import numpy as np
N,C = [int(x) for x in stdin.readline().rstrip().split()]
imos = [[0]*(10**5+1) for i in range(C+1)]

for i in range(N):
    s,t,c = [int(x) for x in stdin.readline().rstrip().split()]
    imos[c][s] += 1
    imos[c][t+1] -= 1

imos = np.array(imos)
#print(np.cumsum(imos,axis=1))
ans = max(np.cumsum(imos,axis=1).sum(axis=0))
print(ans)
Problem p03523 (python)

Fixed submission:
from sys import stdin
S = (stdin.readline().rstrip())
flag = False
for i in ["","A"]:
    for j in ["","A"]:
        for k in ["","A"]:
            for l in ["","A"]:
                s = i + "KIH" + j + "B" + k + "R" + l
                if S == s:
                    flag = True
if flag:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
from sys import stdin
S = (stdin.readline().rstrip())
flag = False
for i in ["","A"]:
    for j in ["","A"]:
        for k in ["","A"]:
            for l in ["","A"]:
                s = i + KIH + j + B + k + R + l
                if S == s:
                    flag = True
if flag:
    print("YES")
else:
    print("NO")
Problem p03544 (python)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
Lucas_number = [0]*(N+1)
Lucas_number[0] = 2
Lucas_number[1] = 1
for i in range(2,N+1):
    Lucas_number[i] = Lucas_number[i-1] + Lucas_number[i-2]
print(Lucas_number[N])

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = int(tdin.readline().rstrip())
Lucas_number = [0]*(N+1)
Lucas_number[0] = 2
Lucas_number[1] = 1
for i in range(2,N+1):
    Lucas_number[i] = Lucas_number[i-1] + Lucas_number[i-2]
print(Lucas_number[N])

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = (tdin.readline(),rstrip())
Lucas_number = [0]*(N+1)
Lucas_number[0] = 2
Lucas_number[1] = 1
for i in range(2,N+1):
    Lucas_number[i] = Lucas_number[i-1] + Lucas_number[i-2]
print(Lucas_number[N])
Problem p03555 (python)

Fixed submission:
from sys import stdin
s1 = (stdin.readline().rstrip())
s2 = (stdin.readline().rstrip())
if s1 == s2[::-1]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
from sys import stdin
s1 = (stdin.readline().rstrip())
s2 = int(stdin.readline().rstrip())
if s1 == s2[::-1]:
    print("YES")
else:
    print("NO")
Problem p03606 (python)

Fixed submission:
from sys import stdin
N = int(stdin.readline().rstrip())
data = []
for _ in range(N):
    data.append([int(x) for x in stdin.readline().rstrip().split()])

ans = 0
for i in data:
    ans += (i[1] - i[0] + 1)
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N = int(stdin.readline().rstrip())
for _ in range(N):
    data.append([int(x) for x in stdin.readline().rstrip().split()])

ans = 0
for i in data:
    ans += (i[1] - i[0] + 1)
print(ans)
Problem p03671 (python)

Fixed submission:
a,b,c = list(map(int,input().split()))
print(min(a+b,b+c,c+a))

Buggy submission (verdict: Runtime Error):
a,b,c = [map(int,input().split())]
print(min(a+b,b+c,c+a))
Problem p03712 (python)

Fixed submission:
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
data = ["#"*(W+2)]
for _ in range(H):
    data.append("#" + input() + "#")
data.append("#"*(W+2))
for j in data:
    print(j)

Buggy submission (verdict: Runtime Error):
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
data = ["#"*(W+2)]
for _ in range(H):
    data.append("#" + input() + "#")
deta.append("#"*(W+2))
for j in data:
    print(j)
Problem p03729 (python)

Fixed submission:
A,B,C = list(input().split())
if A[-1] == B[0] and B[-1] == C[0]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A,B,C = list(map(int,input().split()))
if A[-1] == B[0] and B[-1] == C[0]:
    print("YES")
else:
    print("NO")
Problem p03777 (python)

Fixed submission:
a,b = list(map(str,input().split()))
if a == "D" and b == "D":
    print("H")
elif a == "D" and b == "H":
    print("D")
elif a == "H" and b == "H":
    print("H")
else:
    print("D")

Buggy submission (verdict: Runtime Error):
a,b = list(map(int,input().split()))
if a == "D" and b == "D":
    print("H")
elif a == "D" and b == "H":
    print("D")
elif a == "H" and b == "H":
    print("H")
else:
    print("D")
Problem p03813 (python)

Fixed submission:
x = int(input())
if x < 1200:
    print("ABC")
else:
    print("ARC")

Buggy submission (verdict: Runtime Error):
x = int(input())
if X < 1200:
    print("ABC")
else:
    print("ARC")
Problem p03838 (python)

Fixed submission:
from sys import stdin
import numpy as np
x,y = [int(x) for x in stdin.readline().rstrip().split()]
ans = [(y-x),(y-(-x))+1, (-y+x)+2, (-x-y)+1]
ans = np.array(ans)
ans = ans[ans > 0]
print(min(ans))

Buggy submission (verdict: Runtime Error):
from sys import stdin
import numpy as np
x,y = [int(x) for x in stdin.readline().rstrip().split()]
ans = [(y-x),(y-(-x))+1, (y-x)+2, (x-(-y))+1]
ans = np.array(ans)
ans = ans[ans > 0]
print(min(ans))
Problem p03853 (python)

Fixed submission:
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
C = []
for _ in range(H):
    C.append((input()))
for i in C:
    print(i)
    print(i)

Buggy submission (verdict: Runtime Error):
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
C = []
for _ in range(N):
    C.append((input()))
for i in C:
    print(i)
    print(i)
Problem p03937 (python)

Fixed submission:
import itertools
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
data = []
for _ in range(H):
    data.append(list(input()))

right = 0
down  = 0
for i in data:
    for j in range(0,W-1):
        if i[j] == "#" and i[j+1] == "#":
            right += 1

data_t = []
for i in range(W):
    row = []
    for vector in data:
        row.append(vector[i])
    data_t.append(row)

for i in data_t:
    for j in range(0,H-1):
        if i[j] == "#" and i[j+1] == "#":
            down += 1

if down == H-1 and right == W-1:
    print("Possible")
else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
import itertools
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
data = []
for _ in range(H):
    data.append(list(input()))

flag = False
for j in (itertools.product([0,1],repeat=int((H+W-2)/2))):
    route_flag = True
    right = 0
    down  = 0
    for k in j:
        if k == 1:
            right += 1
        else:
            down += 1
        if data[down][right] == ".":
            route_flag = False
    if route_flag:
        flag = True
    
if data[0][0] == ".":
    flag = False

if flag:
    print("Possible")
else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
import itertools
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
data = []
for _ in range(N):
    data.append(list(input()))

flag = False
for j in (itertools.product([0,1],repeat=(H+W-2))):
    route_flag = True
    right = 0
    down  = 0
    for k in j:
        if k == 1:
            right += 1
        else:
            down += 1
        if data[down][right] == ".":
            route_flag = False
    if foute_flag:
        flag = True
    
if data[0][0] == ".":
    flag = False

if flag:
    print("Possible")
else:
    print("Impossible")
Problem p03962 (python)

Fixed submission:
print(len(set(input().split())))

Buggy submission (verdict: Runtime Error):
from sys import stdin
import math
N = int(stdin.readline().rstrip())
t,a = [int(x) for x in stdin.readline().rstrip().split()]
 
for _ in range(N-1):
    T,A = [int(x) for x in stdin.readline().rstrip().split()]
    n = int(max(math.ceil(t/T),math.ceil(a/A)))
    t = n*T
    a = n*A
    
print(t+a)
Problem p03964 (python)

Fixed submission:
from sys import stdin
import math
N = int(stdin.readline().rstrip())
t,a = 1,1
 
for _ in range(N):
    T,A = [int(x) for x in stdin.readline().rstrip().split()]
    n = max((t + T - 1) // T,(a + A - 1) // A)
    t = n*T
    a = n*A
    
print(t+a)

Buggy submission (verdict: Runtime Error):
from sys import stdin
import math
N = int(stdin.readline().rstrip())
t,a = [int(x) for x in stdin.readline().rstrip().split()]
 
for _ in range(N-1):
    T,A = [int(x) for x in stdin.readline().rstrip().split()]
    int(n) = max(math.ceil(t/T),math.ceil(a/A))
    t = n*T
    a = n*A
    
print(t+a)