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

Fixed submission:
h, w = map(int, input().split())
g = [[0] * w for _ in range(h)]#白が1、黒が０
for i in range(h):
    s = list(input())
    for j in range(w):
        if s[j] == '.':
            g[i][j] = 1
INF = 10**9
dp = [[INF] * w for _ in range(h)]
if g[0][0] == 0:
    dp[0][0] = 1
else:
    dp[0][0] = 0

for i in range(h):
    for j in range(w):
        for dx, dy in ((1, 0), (0, 1)):
            nx = j + dx
            ny = i + dy
            if ny >= h or nx >= w:
                continue
            add = 0
            if g[ny][nx] == 0 and g[i][j]  == 1:
                add = 1
            dp[ny][nx] = min(dp[ny][nx], dp[i][j] + add)
            
print(dp[h-1][w-1])

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
g = [[0] * w for _ in range(h)]#白が1、黒が０
for i in range(h):
    s = list(input())
    for j in range(w):
        if s[j] == '.':
            g[i][j] = 1
INF = 10**9
dp = [[INF] * w for _ in range(h)]
if g[0][0] == 0:
    dp[0][0] = 1
else:
    dp[0][0] = 0

for i in range(h):
    for j in range(w):
        for dx, dy in ((1, 0), (0, 1)):
            nx = j + dx
            ny = i + dy
            if nx >= h or ny >= w:
                continue
            add = 0
            if g[ny][nx] == 0 and g[i][j]  == 1:
                add = 1
            dp[ny][nx] = min(dp[ny][nx], dp[i][j] + add)
            
print(dp[h-1][w-1])
Problem p02819 (python)

Fixed submission:
a = int(input())
def hantei(x):
    k = 0
    for i in range(2, x//2):
        if x % i == 0:
            k += 1
    if k ==0:
        return x

c = True
while c:
    hantei(a)
    b = hantei(a)
    if b is not None:
        print(b)
        c = False
    elif b is None:
        a += 1

Buggy submission (verdict: Runtime Error):
a = int(input())
b = True
def hantei(n, x):
  for i in range(n):
    if n % i == 0:
      x = not x
      return x
while b is True:
  hantei(a, b)
  a += 1
  if not b:
    print(a)
Problem p02831 (python)

Fixed submission:
import fractions
x, y = map(int, input().split())
a = fractions.gcd(x, y)
b = int(x*y/a)
print(b)

Buggy submission (verdict: Runtime Error):
import math
x, y = map(int, input().split())
a = math.gcd(x, y)
print(int(x*y/a))

Buggy submission (verdict: Runtime Error):
import math
x, y = map(int, input().split())
a = math.gcd(x, y)
print(int(x*y/a))

Buggy submission (verdict: Runtime Error):
import math
x, y = map(int, input().split())
a = math.gcd(x, y)
print(int(x*y/a))
Problem p02832 (python)

Fixed submission:
x = int(input())
li = list(map(int, input().split()))
k = 1
s = 0
for i in range(len(li)):
    if k == li[i] :
        k += 1
        s += 1
    if i == len(li)-1 and k == 1:
        s = len(li) + 1
print(len(li)-s)

Buggy submission (verdict: Runtime Error):
x = int(input())
li = list(map(int, input()))
l = []
for i in range(len(li)):
    l.append(i+1-li[i])
print(min(l))

Buggy submission (verdict: Runtime Error):
x = int(input())
li = list(map(int, input()))
from collections import deque
l = deque(li)

def m(p, lis):
    for i in range(len(lis)):
        if lis.leftpop() == p:
            return i+1
    return -1

print(m(x, l))
Problem p02834 (python)

Fixed submission:
import sys
input = sys.stdin.buffer.readline

from collections import deque, defaultdict

#以下０オリジンで考える

n, u, v = map(int, input().split())
u, v = u-1, v-1

G = defaultdict(lambda:deque([])) #連結リスト

#以下０オリジンで考える
for _ in range(n-1):
    a, b = map(int, input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)
    
#start位置から繋がる全ノードへの距離を求める関数、幅優先探索
#dst_dict[player][node]がplayerとnodeの距離
def bfs(start, player):
    que = deque([(start, -1, 0)])
    while que:
        node, par, dst = que.popleft() #par:親, dst:距離
        if len(G[node]) == 1:
            dst_dict[player][node] = dst
            
        for nxt in G[node]:
            if nxt == par:
                continue
            que.append((nxt, node, dst+1))
            
dst_dict = [{}, {}]

bfs(u, 0)
bfs(v, 1)

max_time = 0
for k in dst_dict[0]:
    if dst_dict[0][k] < dst_dict[1][k]:
        max_time = max(max_time, dst_dict[1][k]-1)
    
print(max_time)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.buffer.readline

from collections import deque, defaultdict

#以下０オリジンで考える

n, u, v = map(int, input().split())
u, v = u-1, v-1

G = defaultdict(lambda:deque([])) #連結リスト

#以下０オリジンで考える
for _ in range(n-1):
    a, b = map(int, input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)
    
#start位置から繋がる全ノードへの距離を求める関数、幅優先探索
#dst_dict[player][node]がplayerとnodeの距離
def bfs(start, player):
    que = deque([start, -1, 0])
    while que:
        node, par, dst = que.popleft() #par:親, dst:距離
        if len(G[node]) == 1:
            dst_dict[player][node] = dst
            
        for nxt in graph[node]:
            if nxt == par:
                continue
            que.append((nxt, node, dst+1))
            
dst_dict = [{}, {}]

bfs(u, 0)
bfs(v, 1)

max_time = 0
for k in dst_dict[0]:
    if dst_dict[0][k] < dst_dict[1][k]:
        max_time = max(max_time, dst_dict[1][k]-1)
    
print(max_time)
Problem p02862 (python)

Fixed submission:
def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod

x, y = map(int, input().split())
if  x/y > 2 or y/x > 2:
    print(0)
else:
    if (2*x-y)%3 != 0 or (2*y - x)%3 != 0:
        print(0)
    else:
        a = (2*x-y) / 3
        b = (2*y-x) / 3
        a, b = int(a), int(b)
        mod = 10**9 + 7
        print(comb(a+b, a, mod))

Buggy submission (verdict: Runtime Error):
def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

x, y = map(int, input().split())
if  x/y > 2 or y/x > 2:
    print(0)
else:
    if (2*x-y)%3 != 0 or (2*y - x)%3 != 0:
        print(0)
    else:
        a = (2*x-y) / 3
        b = (2*y-x) / 3
        a, b = int(a), int(b)
        mod = 10**9 + 7
        print(comb(a+b, a, mod))
Problem p02881 (python)

Fixed submission:
n = int(input())
min_ = n -1 
for i in range(1, int(n**0.5)+10):
    if n % i != 0:
        continue
    else:
        min_ = min(min_, i-1+(n//i)-1)
    
print(min_)

Buggy submission (verdict: Runtime Error):
n = int(input())
min_ = n -1 
for i in range(1, n**0.5+10):
  if n % i != 0:
    continue
  else:
    min_ = min(min_, i-1+n//i-1)
    
print(min_)
Problem p02916 (python)

Fixed submission:
n = int(input())
aaa = list(map(int, input().split()))
li_a = []
for i in aaa:
  i -= 1
  li_a.append(i)
li_b = list(map(int, input().split()))
li_c = list(map(int, input().split()))
ans = 0
for i in range(n):
  ans += li_b[li_a[i]]
  if i-1 >= 0:
      if li_a[i] == li_a[i-1]+1:
        ans += li_c[li_a[i-1]]
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
li_a = list(map(int, input().split()))
li_b = list(map(int, input().split()))
li_c = list(map(int, input().split()))
ans = 0
for i in range(n):
  ans += li_b[li[i]]
  if i-1 >= 0:
      if li_a[i] == li_a[i-1]:
        ans += li_c[i-1]
print(ans)
Problem p03018 (python)

Fixed submission:
s = list(input())
li = []
n = len(s)
ans = 0
b = False
for i in range(n-1):
    if b:
        b = False
        continue
    if s[i] + s[i+1] == 'BC':
        li.append('D')
        b = True
    if s[i] == 'B' and s[i+1] != 'C':
        li.append('E')
    if s[i] == 'C':
        li.append('E')
    if s[i] == 'A':
        li.append('A')
cnt = 0
for i in range(len(li)):
    if li[i] == 'A':
        cnt += 1
    elif li[i] == 'E':
        cnt = 0
    else:
        ans += cnt
print(ans)

Buggy submission (verdict: Runtime Error):
from numba import jit
s = list(input())
n = len(s)
ans = 0
@jit
def p(ans):
    for i in range(0, n-2):
        b = True
        if s[i:i+3] == ['A', 'B', 'C']:
            s[i] = 'B'
            s[i+1] = 'C'
            s[i+2] = 'A'
            ans += 1
            b = False
        
    return ans, b
while True:
    ans, b = p(ans)
    if not b:
        break
print(ans)
Problem p03041 (python)

Fixed submission:
n, k = map(int, input().split())
s = list(input())
k -= 1
if s[k] == 'A':
  s[k] = 'a'
elif s[k] == 'B':
  s[k] = 'b'
else:
  s[k] = 'c'
ans = ''
for i in s:
  ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
k -= 1
if s[k] == 'A':
  s[k] = 'a'
elif s[k] == 'B':
  s[k] = 'b'
else:
  s[k] = 'c'
print(s)
Problem p03986 (python)

Fixed submission:
x = list(input())
cnt = 0
a = 0
for i in x:
  if i == 'S':
    cnt += 1
  elif i == 'T':
    if cnt > 0:
      cnt -= 1
    else:
      a += 1
print(a+cnt)

Buggy submission (verdict: Runtime Error):
x = list(input())
cnt = 0
for i in x:
  if x == 'S':
    cnt += 1
  elif y == 'T':
    if cnt > 0:
      cnt -= 1
    else:
      continue
print(len(x)-cnt)
Problem p02688 (python)

Fixed submission:
N, K = [int(i) for i in input().split()]
S = {i for i in range(1, N+1)}

for i in range(K):
    d = int(input())
    A = set([int(i) for i in input().split()])
    S = S - (S & A)

print(len(S))

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

has_snack = set()
for i in range(K):
    d = int(input())
    A = set(map(int, input().split()))
    has_snack += A

print(N-len(has_snack))
Problem p02879 (python)

Fixed submission:
a,b=[int(i) for i in input().split()]
if 0<a<10 and 0<b<10:
    print(a*b)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
a,b=[i for i in input().split()]
if a<10 and b<10:
    print(a*b)
else:
    print(-1)
Problem p03013 (python)

Fixed submission:
N, M = map(int, input().split())
A = set([int(input()) for _ in range(M)])

dp = [0, 1]
for i in range(N):
    if i+1 in A: dp.append(0)
    else: dp.append(dp[i]+dp[i+1])
print(dp[N+1]%1000000007)

Buggy submission (verdict: Runtime Error):
N, M = [int(i) for i in input().split()]
A = {int(input()) for _ in range(M)}

dp = [0] * 10100
dp[0] = 1
dp[1] = 0 if 1 in A else 1

for i in range(2, N+1):
    if not i-1 in A:
        dp[i] += dp[i-1]
    if not i-2 in A:
        dp[i] += dp[i-2]
    dp[i] %= 1000000007

print(dp[N])

Buggy submission (verdict: Runtime Error):
N, M = [int(i) for i in input().split()]

dp = [-1] * 10100
dp[0] = 1
dp[1] = 1

for i in range(M):
    a = int(input())
    dp[a] = 0

for i in range(N):
    if dp[i+2] == 0: continue
    dp[i+2] = dp[i]+dp[i+1]

print(dp[N] % 1000000007)

Buggy submission (verdict: Runtime Error):
N, M = [int(i) for i in input().split()]
A = {int(input()) for _ in range(M)}

dp = [0] * 20000
dp[0] = 1
dp[1] = 0 if 1 in A else 1
for i in range(N):
    if i+2 in A:
        continue
    dp[i+2] = dp[i] + dp[i+1]

print(dp[N] % 1000000007)

Buggy submission (verdict: Runtime Error):
N, M = [int(i) for i in input().split()]
A = {int(input()) for _ in range(M)}

dp = [0] * 10010
dp[0] = 1
dp[1] = 0 if 1 in A else 1
for i in range(N):
    if i+2 in A:
        continue
    dp[i+2] = dp[i] + dp[i+1]

print(dp[N] % 1000000007)
Problem p03075 (python)

Fixed submission:
b=True
a=[int(input()) for i in range(5)]
k=int(input())
for j in range(5):
  for l in range(5):
    if a[j]-a[l] > k:
      b=False
if b:
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
antenna = [int(input()) for _ in range(N)]
k = int(input())

print("Yay!" if max(antenna) - min(antenna) <= k else ":(")
Problem p03207 (python)

Fixed submission:
n = int(input())
p = [int(input()) for _ in range(n)]
ex = p.pop(p.index(max(p)))
print(int(ex / 2) + sum(p))

Buggy submission (verdict: Runtime Error):
n = int(input())
p = [int(input()) for _ in range(n)]
ex = l.pop(l.index(max(l)))
print(int(ex / 1) + sum(l))
Problem p02571 (python)

Fixed submission:
s = input().strip()
t = input().strip()

if t in s:
    print(0)
else:
    ans = 10001
    for i in range(len(s) - len(t) + 1):
        count = 0
        cnt = i
        for j in range(len(t)):
            if s[cnt] != t[j]:
                count += 1
            cnt += 1
        ans = min(count, ans)
    print(ans)

Buggy submission (verdict: Runtime Error):
s = input().strip()
t = input().strip()

if t in s:
    print(0)
else:
    ans = 1000
    for i in range(len(s) - len(t) - 1):
        count = len(t) - 1
        for j in range(len(t) - 1):
            if s[i + j] == t[i]:
                count -= 1
        ans = min(count, ans)
    print(ans)
Problem p02623 (python)

Fixed submission:
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

#累積和
sa = [0]
sb = [0]
for i in range(n):
    sa.append(sa[i]+a[i])
for i in range(m):
    sb.append(sb[i]+b[i])

#片方全部見ていくともう片方が簡単に求まる
ans = 0
for i in range(n+1):
    if sa[i] > k:
        break
    while sb[m] > k - sa[i]:
        m -= 1
    ans = max(ans,i+m)
print(ans)

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

#累積和
sa = [0]
sb = [0]
for i in range(n):
    sa.append(sa[i]+a[i])
for i in range(m):
    sb.append(sb[i]+b[i])
    
#片方全部見ていくともう片方が簡単に求まる
ans = 0
for i in range(n+1):
    if a[i] > k:
        break
    while b[m] > k - a[i]:
        m -= 1
    ans = max(ans,i+m)
print(ans)

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

#累積和
sa = [0]*len(a)
sa[0] = a[0]
for i,k in enumerate(a):
    if i == 0:continue
    sa[i] = sa[i-1] + a[i]
sb = [0]*len(b)
sb[0] = b[0]
for i,k in enumerate(b):
    if i == 0:continue
    sb[i] = sb[i-1] + b[i]

ai = len(a)-1
bi = len(b)-1

minu = sa[ai] + sb[bi]
while(minu > K):
    if (sa[ai] - sa[ai-1]) > (sb[bi] - sb[bi-1]):
        ai -= 1
        minu = sa[ai] + sb[bi]
    else:
        bi -= 1
        minu = sa[ai] + sb[bi]

print(ai + bi + 2)

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

#累積和
sa = [0]*len(a)
sa[0] = a[0]
for i,k in enumerate(a):
    if i == 0:continue
    sa[i] = sa[i-1] + a[i]
sb = [0]*len(b)
sb[0] = b[0]
for i,k in enumerate(b):
    if i == 0:continue
    sb[i] = sb[i-1] + b[i]

ai = len(a)-1
bi = len(b)-1

minu = sa[ai] + sb[bi]
while(minu > K):
    if (sa[ai] - sa[ai-1]) > (sb[bi] - sb[bi-1]):
        ai -= 1
        minu = sa[ai] + sb[bi]
    else:
        bi -= 1
        minu = sa[ai] + sb[bi]

print(sa)
print(sb)
print(ai + bi + 2)
Problem p02773 (python)

Fixed submission:
from collections import Counter
n=int(input())
s=[]
for _ in range(n):
    s.append(input())
c = Counter(s)
ans=[]
max_vote = max(c.values())
for i,j in c.items():
    if j == max_vote:
        ans.append(i)
print("\n".join(sorted(ans)))

Buggy submission (verdict: Runtime Error):
def main():
    from collections import Counter
    import sys
    input = sys.stdin.readline
    n=int(input())
    s=[]
    for _ in []*n:
        s.append(input().rstrip())
    c = Counter(s)
    ans=[]
    max_vote = max(c.values())
    for i,j in c.items():
        if j == max_vote:
            ans.append(i)
    print("\n".join(sorted(ans)))
main()
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()

if n % 2 == 0:
    t = s[0:int(n/2)]
    if s == t + t:
        print("Yes")
        exit()
print("No")

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

if n % 2 == 0:
    t = s[0:n/2]
    if s == t + t:
        print("Yes")
        exit()
print("No")
Problem p03013 (python)

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

a = []
for _ in range(m):
    tmp = int(input())
    a.append(tmp)
a = set(a)

dp = [0] * (10**5 + 7)
dp[0] = 1

for i in range(1,n+1):
    if i in a:
        continue
    dp[i] = dp[i-1]
    if i > 1:
        dp[i] = (dp[i-1] + dp[i-2])%mod

print(dp[n]%mod)

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

a = []
for _ in range(m):
    tmp = int(input())
    a.append(tmp)
a = set(a)

dp = [0] * 10**5
dp[0] = 1

for i in range(1,n+1):
    if i in a:
        continue
    dp[i] = dp[i-1]
    if i > 1:
        dp[i] = (dp[i-1] + dp[i-2])%mod

print(dp[n]%mod)
Problem p02735 (python)

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

import numpy as np
dp = np.zeros((h,w),np.int32)
s = np.full((h,w),'.',np.str)
for H in range(h):
    S = input()
    for W in range(w):
        s[H][W] = S[W]
        own = s[H][W]
        if H==0 and W==0: dp[H][W] = 0 if own=='.' else 1
        elif H==0: dp[H][W] = dp[H][W-1]+1 if s[H][W-1]=='.' and own=='#' else dp[H][W-1]
        elif W==0: dp[H][W] = dp[H-1][W]+1 if s[H-1][W]=='.' and own=='#' else dp[H-1][W]
        else:
            dp[H][W] = min(dp[H][W-1], dp[H-1][W])
            if own=='#':
                if s[H][W-1]=='.' and s[H-1][W]=='.': dp[H][W] += 1
                elif s[H][W-1]=='#' and s[H-1][W]=='.': dp[H][W] = min(dp[H][W-1], dp[H-1][W]+1)
                elif s[H][W-1]=='.' and s[H-1][W]=='#': dp[H][W] = min(dp[H][W-1]+1, dp[H-1][W])
print(dp[h-1,w-1])

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

import numpy as np
dp = np.zeros((h,w),np.int32)
s = np.full((h,w),'.')
for H in range(h):
    S = input()
    for W in range(w):
        s[H][W] = S[W]
        own = s[H][W]
        if H==0 and W==0: dp[H][W] = 0 if own=='.' else 1
        elif H==0: dp[H][W] = dp[H][W-1]+1 if s[H][W-1]=='.' and own=='#' else dp[H][W-1]
        elif W==0: dp[H][W] = dp[H-1][W]+1 if s[H-1][W]=='.' and own=='#' else dp[H-1][W]
        else:
            dp[H][W] = min(dp[H][W-1], dp[H-1][W])
            if own=='#':
                if s[H][W-1]=='.' and s[H-1][W]=='.': dp[H][W] += 1
                elif s[H][W-1]=='#' and s[H-1][W]=='.': dp[H][W] = min(dp[H][W-1], dp[H-1][W]+1)
                elif s[H][W-1]=='.' and s[H-1][W]=='#': dp[H][W] = min(dp[H][W-1]+1, dp[H-1][W])
print(dp[h-1,w-1])
Problem p02753 (python)

Fixed submission:
s = input()
if s=='AAA' or s=='BBB':
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
s = input()
if s=='AAA' or s='BBB':
    print('No')
else:
    print('Yes')
Problem p02831 (python)

Fixed submission:
# 21:09
a,b = map(int,input().split())
import fractions
lcm = a*b // fractions.gcd(a,b)
print(lcm)

Buggy submission (verdict: Runtime Error):
# 21:09
a,b = map(int,input().split())
import math
lcm = a*b // math.gcd(a,b)
print(lcm)
Problem p03803 (python)

Fixed submission:
c = input().split()
a = int(c[0])
b = int(c[1])
if a == 1:
    a = 14
if b == 1:
    b = 14

if a > b:
    print("Alice")
elif b > a:
    print("Bob")
else:
    print("Draw")

Buggy submission (verdict: Runtime Error):
n = input().split()

ar = int(n[0])
br = int(n[1])

a = []
b = []
for i in range(0, ar):
    a.append(input())

for j in range(0, br):
    b.append(input())

find = False
for i in range(0, ar - br):
    idx = a[i].find(b[0])
    if idx != -1:
        match = True
        for j in range(1, br):
            idx2 = a[i + j].find(b[j])
            if idx != idx2:
                match = False
        if match:
            find = True
            break
if find:
    print("Yes")
else:
    print("No")
Problem p02711 (python)

Fixed submission:
# for #!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase


def main():
	# for t in range(int(input())):
		n = input()
		if n.count("7")>0:
			print("Yes")
		else:
			print("No")
		
		


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = "x" in file.mode or "r" not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b"\n") + (not b)
			ptr = self.buffer.tell()
			self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode("ascii"))
		self.read = lambda: self.buffer.read().decode("ascii")
		self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
n = input()
if n.count("7")>0:
  print("Yes")
  else:
    print("No")
Problem p02880 (python)

Fixed submission:
n = int(input())
for i in range(1,10):
    if n%i == 0:
        if n//i in range(1,10):
            print("Yes")
            break
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(2,10):
  while n%i == 0:
    n = n/i
if n==1:
  print("Yes)
else:
        print("No")
Problem p03315 (python)

Fixed submission:
s=list(input())
p=0
for i in  range(4):
  if s[i]=="+":
    p=p+1
  else:
    p=p-1
print(p)

Buggy submission (verdict: Runtime Error):
n=input()
x=int(n)
b=0
for i in n:
  b+=int(i)

if x%b==0:
  print("Yes")
else:
  print("No")
Problem p02659 (python)

Fixed submission:
from math import floor
A= input().split()
p = int(A[0])
q = round(float(A[1])*100)
t = p*q
t //= 100
print(t)

Buggy submission (verdict: Runtime Error):
from math import floor
A= input().split()
p = int(A[0])
q = float(A[1]*100)
t = p*q
p //= 100
print(p)

Buggy submission (verdict: Runtime Error):
import math as m

def Div():
    N = int(input())
    c = 0
    k = N//2 + 1
    for i in range(2,k):
        if(prime(i)):
            for j in range(1,int(m.sqrt(N))+1):
                p = i ** j
                if(p>N):
                    break
                if(N%p==0):
                    N = N //p
                    c = c + 1
    
    return c

print(Div())

Buggy submission (verdict: Runtime Error):
def multi3():
    nums = list(map(float,input().split()))
    return m.floor(nums[0] * nums[1])


if __name__ == "__main__":
    print(multi3())