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

Fixed submission:
n = int(input())
l = []
for i in range(n):
    tmp = list(map(int,input().split()))
    l.append(tmp)

if len(l) == 1:
    print(1)
    exit()


from collections import defaultdict
d = defaultdict(int)

for i in range(len(l)):
    for j in range(len(l)):
        difx = l[i][0] - l[j][0]
        dify = l[i][1] - l[j][1]
        if difx!=0 or dify!=0:
            dif = str(difx) + "_" + str(dify)
            d[dif] += 1

p_q = max((v,k) for (k,v) in d.items())[1]
p,q = p_q.split("_")

ans=0
for i in range(len(l)):
    found=False
    for j in range(len(l)):
        difx = l[i][0] - l[j][0]
        dify = l[i][1] - l[j][1]
        if difx==int(p) and dify==int(q):
            found=True
            break
    if not found:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = []
for i in range(n):
    tmp = list(map(int,input().split()))
    l.append(tmp)

from collections import defaultdict
d = defaultdict(int)

for i in range(len(l)):
    for j in range(len(l)):
        difx = l[i][0] - l[j][0]
        dify = l[i][1] - l[j][1]
        if difx!=0 or dify!=0:
            dif = str(difx) + "_" + str(dify)
            d[dif] += 1

p_q = max((v,k) for (k,v) in d.items())[1]
p,q = p_q.split("_")

ans=0
for i in range(len(l)):
    found=False
    for j in range(len(l)):
        difx = l[i][0] - l[j][0]
        dify = l[i][1] - l[j][1]
        if difx==int(p) and dify==int(q):
            found=True
            break
    if not found:
        ans+=1
print(ans)
Problem p03023 (python)

Fixed submission:
print(180*(int(input())-2))

Buggy submission (verdict: Runtime Error):
print(180*(int(input())−2))
Problem p03024 (python)

Fixed submission:
s=input()
k=len(s)
import collections
c = collections.Counter(s)
win = c["o"]

if win+15-k>=8:
  print("YES")
else:
  print("NO")

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

import collections
c = collections.Counter(s)

win = c["o"]

if win-k>=23:
  print("YES")
else:
  print("NO")
Problem p03044 (python)

Fixed submission:
n = int(input())
l=[]
for i in range(n-1):
    tmp = list(map(int,input().split()))
    l.append(tmp)
l.sort()

link = [[] for _ in range(n)]

for tmp in l:
    link[tmp[0]-1].append([tmp[1]-1,tmp[2]])
    link[tmp[1]-1].append([tmp[0]-1,tmp[2]])

from collections import deque
Q = deque()
Q.append(0)

dis = [-1]*n
dis[0]=0

while Q:
    num=Q.popleft()
    for tmp in link[num]:
        if dis[tmp[0]] == -1:
            dis[tmp[0]] = dis[num]+tmp[1]
            Q.append(tmp[0])

for a in dis:
    print(a%2)

Buggy submission (verdict: Runtime Error):
n = int(input())
l=[]
for i in range(n-1):
    tmp = list(map(int,input().split()))
    l.append(tmp)
l.sort()

from collections import deque
Q = deque()
Q.append(0)

dis = [0]*n
dis[0]=0

while Q:
    num=Q.popleft()

    for tmp in l:
        if tmp[0]-1 == num:
            nxt=tmp[1]-1
            Q.append(nxt)
            dis[nxt] = dis[num] + tmp[2]

for a in dist:
    print(a%2)
Problem p03067 (python)

Fixed submission:
a,b,c= map(int, input().split())
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")

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 p03076 (python)

Fixed submission:
lis=[]
lis.append(int(input()))
lis.append(int(input()))
lis.append(int(input()))
lis.append(int(input()))
lis.append(int(input()))
ans=0
lis_h=[]
for i in range(5):
        hito=int(str(lis[i])[-1])
        time=lis[i]
        if hito==0:
                ans+=time
        else:
                lis_h.append([hito,time])
lis_h.sort()

if len(lis_h)==0:
        print(ans)
        exit()
ans+=lis_h[0][1]

for i in range(len(lis_h)):
        if i==0:
                continue
        num = (lis_h[i][1]//10) * 10
        if lis_h[i][0] != 0:
                num+=10
        ans+=num

print(ans)

Buggy submission (verdict: Runtime Error):
lis=[]
lis.append(int(input()))
lis.append(int(input()))
lis.append(int(input()))
lis.append(int(input()))
lis.append(int(input()))
ans=0
lis_h=[]
for i in range(5):
        hito=int(str(lis[i])[-1])
        time=lis[i]
        if hito==0:
                ans+=time
        else:
                lis_h.append([hito,time])
lis_h.sort()
ans+=lis_h[0][1]

for i in range(len(lis_h)):
        if i==0:
                continue
        num = (lis_h[i][1]//10) * 10
        if lis_h[i][0] != 0:
                num+=10
        ans+=num

print(ans)
Problem p03085 (python)

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

Buggy submission (verdict: Runtime Error):
s=input()
if s=="A":
  print("T")
eilf s=="T":
  print("A")
eilf s=="C":
  print("G")
eilf s=="G":
  print("C")
Problem p03087 (python)

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

lr=[]
for _ in range(q):
    D = list(map(int, input().split()))
    lr.append(D)

ac_list=[]

for i in range(len(s)-1):
    if s[i]=="A" and s[i+1]=="C":
        ac_list.append(i)

import bisect

for j in range(q):
    ind1 = bisect.bisect_left(ac_list,lr[j][0]-1)
    ind2 = bisect.bisect_left(ac_list,lr[j][1]-1)

    print(ind2-ind1)

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

lr=[]
for _ in range(q):
    D = list(map(int, input().split()))
    lr.append(D)

ac_list=[]

for i in range(len(s)):
    if s[i]=="A" and s[i+1]=="C":
        ac_list.append(i)

import bisect

for j in range(q):
    ind1 = bisect.bisect_left(ac_list,lr[j][0]-1)
    ind2 = bisect.bisect_left(ac_list,lr[j][1]-1)

    print(ind2-ind1)
Problem p03089 (python)

Fixed submission:
n=int(input())
b = list(map(int, input().split()))
ans=[]
for num in range(n):
    dl=-1
    for i in range(len(b)):
        if b[i] == i+1:
            dl=i
    if dl==-1:
        print(-1)
        exit()
    b.pop(dl)
    ans.append(dl+1)
ans = list(reversed(ans))
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
n=int(input())
b = list(map(int, input().split()))
ans=[]
dl = -1
for num in range(n):
    for i in range(len(b)):
        if b[i] == i+1:
            dl=i
    if dl==-1:
        print(-1)
        exit()
    b.pop(dl)
    ans.append(dl+1)
ans = list(reversed(ans))
for i in ans:
    print(i)
Problem p03130 (python)

Fixed submission:
l = []
for i in range(3):
  a,b = map(int, input().split())
  l.append(a)
  l.append(b)

for i in range(1,5):
  cnt=0
  for itm in l:
    if i==itm:
      cnt+=1
  if cnt>=3:
    print("NO")
    exit()
print("YES")

Buggy submission (verdict: Runtime Error):
l = []
for i in range(3):
  a,b = map(int, input().split())
  l.append(a)
  l.append(b)

for i in range(1,5):
  cnt=0
  for itm in l:
    if i==l:
      cnt+=1
  if cnt>=3:
    print("NO")
 	exit()
print("YES")
Problem p03147 (python)

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

mizu=0

while True:

    end=True
    for i in range(n):
       if h[i]!=0:
           end=False

    if end:
        break

    for l in range(n):
        if h[l]!=0:
            break

    for r in range(l,n):
        if h[r]==0:
            r-=1
            break

    mizu+=1
    for i in range(l,r+1):
        h[i] -= 1

print(mizu)

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

res=0


while True:

#       print(H)
        for l in range(N):
                if H[l]!=0:
                        break
        for r in range(l+1,N):
                if H[r]==0:
                        r-=1
                        break

#       print(l,r)

        if l>r:
                break

        if l==r:
                miin=H[l]
        else:
                miin=min(H[l:r])


#       print(min(H[l:r]))

        res+=miin

        if miin == 0:
                break

        for i in range(l,r+1):
                H[i] -= miin


res += H[N-1]
print(res)

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

res=0


while True:

#       print(H)
        for l in range(N):
                if H[l]!=0:
                        break
        for r in range(l+1,N):
                if H[r]==0:
                        r-=1
                        break

#       print(l,r)

        if l>r:
                break

        if l==r:
                miin=H[l]
        else:
                miin=min(H[l:r])


#       print(min(H[l:r]))

        res+=miin

        if miin == 0:
                break

        for i in range(l,r+1):
                H[i] -= miin


res += H[N-1]
print(res)
Problem p03150 (python)

Fixed submission:
s = input()
import re
if "keyence" == s:
    print("YES")
    exit()

if re.fullmatch(".*keyence",s) is not None:
    print("YES")
    exit()

if re.fullmatch("k.*eyence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("ke.*yence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("key.*ence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keye.*nce",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyen.*ce",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyenc.*e",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyence.*",s) is not None:
    print("YES")
    exit()
print("NO")

Buggy submission (verdict: Runtime Error):
s = input()
import re
if "keyence" == s:
    print("YES")
    exit()

if re.fullmatch(".*keyence",s) is not None:
    print("YES")
    exit()

if re.fullmatch("k.*eyence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("ke.*yence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("key.*ence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keye.*nce",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyen.*ce",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyenc.*e",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyence.*",s) is not None:
    print("YES")
    exit()
print("NO")
Problem p03151 (python)

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

if sum(a) < sum(b):
    print("-1")
    exit()
yobun_sum = []

for i in range(N):
    if a[i] > b[i]:
        yobun_sum.append(a[i]-b[i])

yobun_sum.sort()
yobun_sum.reverse()
yobun_cum_sum=[]
cum_sum=0
for i in yobun_sum:
    cum_sum+=i
    yobun_cum_sum.append(cum_sum)

lack_num=0
lack_sum=0

for i in range(N):
    if a[i] < b[i]:
        lack_num+=1
        lack = abs(a[i] - b[i])
        lack_sum+=lack

for i in range(len(yobun_cum_sum)):
    if yobun_cum_sum[i] >= lack_sum:
        break

if lack_sum==0:
    print(0)
else:
    print(lack_num+i+1)

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

if sum(a) < sum(b):
    print("-1")
    exit()
yobun_sum = []

for i in range(N):
    if a[i] > b[i]:
        yobun_sum.append(a[i]-b[i])

yobun_sum.sort()
yobun_sum.reverse()

yobun_cum_sum=[]
cum_sum=0
for i in yobun_sum:
    cum_sum+=i
    yobun_cum_sum.append(cum_sum)

yobun_ind = 0
lack_num=0
use_first=False

for i in range(N):
    if a[i] < b[i]:
        use_first=True
        lack_num+=1
        lack = abs(a[i] - b[i])
        if yobun_cum_sum[yobun_ind] >= lack: # can pay
            yobun_cum_sum[yobun_ind] -= lack
        else: # can't pay
            yobun_cum_sum[yobun_ind+1] -= lack - yobun_cum_sum[yobun_ind]
            yobun_cum_sum[yobun_ind] =0
            yobun_ind+=1

if use_first:
    yobun_ind+=1

print(yobun_ind+lack_num)
Problem p03162 (python)

Fixed submission:
N = int(input())
S = []
for _ in range(N):
    D = list(map(int, input().split()))
    S.append(D)

import numpy as np
#dp=np.zeros((N+1,3))

dp = [[0 for _ in range(3)] for _ in range(N+1)]

for i in range(1,N+1):
    for j in range(3):
        for k in range(3):
            if j != k:
                happy =  dp[i-1][k] + S[i-1][j]
                if dp[i][j] < happy:
                    dp[i][j] = happy

print(int(max(dp[N])))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = []
for _ in range(N):
    D = list(map(int, input().split()))
    S.append(D)

import numpy as np
dp=np.zeros((N+1,3))

for i in range(1,N+1):
    for j in range(3):
        for k in range(3):
            if j != k:

                dp[i][j] = max(dp[i-1][k] + S[i-1][j],dp[i][j])
                #happy =  dp[i-1][k] + S[i-1][j]
                #if dp[i][j] < happy:
                #    dp[i][j] = happy

print(int(max(dp[N])))
Problem p03163 (python)

Fixed submission:
n,w = map(int, input().split())
wv = []
for _ in range(n):
    data = list(map(int,input().split()))
    wv.append(data)

dp = [[0 for i in range(w+1)] for j in range(n+1)]

for item in range(n):
    now_w=wv[item][0]
    now_v=wv[item][1]

    for weight in range(w+1):
        ans1=dp[item][weight]
        ans2=-1
        if weight - now_w >= 0:
            ans2=dp[item][weight-now_w]+now_v
        dp[item+1][weight] = max(ans1,ans2)

print(dp[n][w])

Buggy submission (verdict: Runtime Error):
    n,w = map(int, input().split())
    wv = []
    for _ in range(n):
        data = list(map(int,input().split()))
        wv.append(data)
     
    dct={}
     
    def solve(i,j):
        if i>=n:
            return 0
     
        ky = str(i)+"_"+str(j)
        if ky in dct:
            return dct[ky]
     
     
        weight=wv[i][0]
        value =wv[i][1]
     
        if j<weight: # can't push this item
            val = solve(i+1,j)
        else:# push or not push
            val =  max(solve(i+1,j-weight)+value, solve(i+1,j))
     
        dct[ky] = val
     
        return val
     
    print(solve(0,w))

Buggy submission (verdict: Runtime Error):
n,w = map(int, input().split())
wv = []
for _ in range(n):
    data = list(map(int,input().split()))
    wv.append(data)


memo = [[-1] * (n+10)]*(w+10)

def solve(i,j):
    if i>=n:
        return 0

    if memo[i][j] != -1:
        return memo[i][j]

    weight=wv[i][0]
    value =wv[i][1]

    if j<weight: # can't push this item
        val = solve(i+1,j)
    else:# push or not push
        val =  max(solve(i+1,j-weight)+value, solve(i+1,j))

    memo[i][j] = val

    return val

print(solve(0,w))
Problem p03196 (python)

Fixed submission:
def divs(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n,p = map(int, input().split())
if n>100:
  print(1)
  exit()

ans=1
for d in divs(p):
  if pow(d,n)>p:
    break
  if p % pow(d,n)==0:
    ans=d
print(ans)

Buggy submission (verdict: Runtime Error):
def divs(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n,p = map(int, input().split())
ans=1
for d in divs(p):
  if pow(d,n)>p:
    break
  if p % pow(d,n)==0:
    ans=d
print(ans)
Problem p03254 (python)

Fixed submission:
n,x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
ans=0
for i in range(n):
  if a[i] == x:
    ans+=1
    break
  elif a[i] > x:
    break
  else:
    if i!=(n-1):
      ans+=1
      x-=a[i]
print(ans)

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

a.sort()

for i in range(n):
  if a[i] == n:
    ans+=1
    break
  elif a[i] > n:
    break
  else:
    if i!=n(-1):
      ans+=1
      n-=a[i]
print(ans)
Problem p03282 (python)

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

not1=-1
for i in range(len(s)):
        if s[i] != "1":
                not1=i
                break

if not1==-1:
        print(1)
elif k > not1:
        print(s[not1])
else:
        print(1)

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
for i in range(len(s)):
        if s[i] != "1":
                not1=i
                break
if k > not1:
        print(s[not1])
else:
        print(1)
Problem p03337 (python)

Fixed submission:
A,B = map(int, input().split())
print(max(A+B,A-B,A*B))

Buggy submission (verdict: Runtime Error):
A,B = map(int, input().split())
print(max(A+B,A−B,A*B))

Buggy submission (verdict: Runtime Error):
A,B = map(int, input().split())
print(max([A+B, A−B, A*B]))

Buggy submission (verdict: Runtime Error):
A,B = map(int, input().split())
print(max([A+B, A−B, A×B]))
Problem p03363 (python)

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

s=[0]
sm=0
for i in a:
    sm+=i
    s.append(sm)
s.sort()
import collections
c = collections.Counter(s)

ans=0
for v in c.values():
    if v>1:
        ans+=v*(v-1)//2

print(int(ans))

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

s=[0]
sm=0
for i in a:
    sm+=i
    s.append(sm)
s.sort()
import collections
c = collections.Counter(s)
from math import factorial
def ncr(n,r):
    return factorial(n) / factorial(r) / factorial(n - r)
ans=0
for v in c.values():
    if v>1:
        ans+=ncr(v,2)

print(int(ans))

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

s=[0]
sm=0
for i in a:
    sm+=i
    s.append(sm)
s.sort()
import collections
c = collections.Counter(s)
from math import factorial
def ncr(n,r):
    return factorial(n) / factorial(r) / factorial(n - r)
ans=0
for v in c.values():
    if v>1:
        ans+=ncr(v,2)

print(int(ans))
Problem p03416 (python)

Fixed submission:
def isp(str): return True if str == str[::-1] else False
a,b= map(int, input().split())
ans=0
for i in range(a,b+1):
  i_s=str(i)
  if isp(i_s):
    ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
def isp(str): return True if str == str[::-1] else False
a=int(input())
b=int(input())
ans=0
for i in range(a,b+1):
  i_s=str(i)
  if isp:
    ans+=1
    
print(ans)
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 x%y==0
  print(-1)
else:
  print(x)
Problem p03439 (python)

Fixed submission:
n=int(input())
def ceil(a,b):
    ret = -(-a//b)
    if ret%2==0:
        return ret
    else:
        return ret+1

print(0)
first=input()
if first=="Vacant":
    exit()

l=0
r=n

while abs(l-r)>5:
    nxt = ceil(l+r,2)
    print(nxt)
    ans=input()
    if ans=="Vacant":
        exit()
    if ans==first:
        l=nxt
    else:
        r=nxt


for i in range(l,r):
    print(i)
    ans=input()
    if ans=="Vacant":
        exit()

Buggy submission (verdict: Runtime Error):
n=int(input())
def ceil(a,b):
    ret = -(-a//b)
    if ret%2==0:
        return ret
    else:
        return ret+1

print(0)
first=input()
if first=="Vacant":
    exit()

l=0
r=n

while abs(l-r)>5:
    nxt = ceil(l+r,2)
    print("l==",l,"r==",r)
    print(nxt)
    ans=input()
    if ans=="Vacant":
        exit()
    if ans==first:
        l=nxt
    else:
        r=nxt


for i in range(l,r):
    print(i)
    ans=input()
    if ans=="Vacant":
        exit()

Buggy submission (verdict: Runtime Error):
n=int(input())
def ceil(a,b):
    ret = -(-a//b)
    if ret%2==0:
        return ret
    else:
        return ret+1

print(0)
first=input()
if first=="Vacant":
    exit()

l=0
r=n

while abs(l-r)>3:
    nxt = ceil(l+r,2)
    print("l==",l,"r==",r)
    print(nxt)
    ans=input()
    if ans=="Vacant":
        exit()
    if ans==first:
        l=nxt
    else:
        r=nxt


for i in range(l,r):
    print(i)
    ans=input()
    if ans=="Vacant":
        exit()
Problem p03470 (python)

Fixed submission:
n=int(input())
l=[]
for i in range(n):
  l.append(int(input()))
print(len(set(l)))

Buggy submission (verdict: Runtime Error):
n=input()
l=[]
for i in range(n):
  l.append(int(input()))
print(len(set(l)))

Buggy submission (verdict: Runtime Error):
n=input()
l=[]
for i in range(n):
  l.apend(int(input()))
print(len(set(l)))
Problem p03478 (python)

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

ans=0
for i in range(n):
  num=str(i+1)
  sm=0
  for j in num:
    sm+=int(j)
  if a<=sm<=b:
    ans+=(i+1)
print(ans)

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

ans=0
for i in range(n):
  num=str(i+1)
  sm=0
  for j in num:
    sm+=j
  if a<=sm<=b:
    ans+=1
print(ans)

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

ans=0
for i in range(n)
  num=str(i+1)
  sm=0
  for j in num:
    sm+=j
  if a<=sm<=b:
    ans+=1
print(ans)
Problem p03487 (python)

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

from collections import defaultdict
d = defaultdict(int)

for num in a:
    d[num]+=1

ans=0
for num,cnt in d.items():
    if num > cnt:
        ans+=cnt
    else:
        ans+=cnt-num
print(ans)

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

ans=0
lastnum=a[0]
cnt=1
for num in a[1:]:
    if num==lastnum:
        cnt+=1
    else:
        ans+=min(cnt,abs(cnt-lastnum))
        cnt=1
    tmp=lastnum
    lastnum=num

ans+=min(cnt,abs(cnt-tmp))
print(ans)
Problem p03502 (python)

Fixed submission:
n=int(input())
st=str(n)

sm = 0
for i in st:
  sm+=int(i)
if n%sm==0:
  print("Yes")
else:
  print("No")

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

sm = 0
for i in st:
  sm+=int(i)
if n%sm==0:
  print("Yes")
else
  print("No")
Problem p03503 (python)

Fixed submission:
n = int(input())
f=[]
for i in range(n):
    tmp = list(map(int,input().split()))
    f.append(tmp)
p=[]
for i in range(n):
    tmp = list(map(int,input().split()))
    p.append(tmp)

from itertools import *
first=True
ans=-10**12
for tmp in list(product([0,1], repeat=10)):
    if first:
        first=False
        continue

    ona=[]
    for mise in f:
        cnt=0
        for j in range(10):
            cnt+= tmp[j] & mise[j]
        ona.append(cnt)

    sm=0
    for i in range(len(p)):
        sm+=p[i][ona[i]]
    if ans < sm:
        ans=sm
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
f=[]
for i in range(n):
    tmp = list(map(int,input().split()))
    f.append(tmp)
p=[]
for i in range(n):
    tmp = list(map(int,input().split()))
    p.append(tmp)

from itertools import *
first=True
ans=-10**12
for tmp in list(product([0,1], repeat=10)):
    if first:
        first=False
        continue

    for i in range(n):
        cnt=0
        for j in range(10):
            cnt+= tmp[j] & mise[j]
        sm=0
        for i in range(n):
            sm+=p[i][cnt]
        if ans < sm:
            ans=sm
print(ans)
Problem p03564 (python)

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

now=1
for i in range(n):
  if now*2 >=now+k:
  	now+=k
  else:
    now*=2
print(now)

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

now=1
for i in range(n):
  if now*2 >=k
  	now+=k
  else:
    now*=2
print(now)
Problem p03587 (python)

Fixed submission:
s=input()
print(s.count("1"))

Buggy submission (verdict: Runtime Error):
s=input()
print(s.count("1")
Problem p03600 (python)

Fixed submission:
import sys
input=sys.stdin.readline
n=int(input())
wf=[list(map(int,input().split())) for i in range(n)]

ans=0
for i in range(n):
    for j in range(i+1,n):
        use=True
        for h in range(n):
            if h!=i and h!=j and wf[i][j] > wf[i][h]+wf[h][j]:
                print(-1)
                exit()
            if h!=i and h!=j and wf[i][j] == wf[i][h]+wf[h][j]:
                use=False
        if use:
            ans+=wf[i][j]
print(int(ans))

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

from scipy.sparse.csgraph import floyd_warshall
wf=floyd_warshall(a)

if not (a==wf).all() :
    print(-1)
    exit()