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

Fixed submission:
a,b=map(int,input().split())
c = int(500*a-b)
if c >=0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=int(500*a-b)
if c >0:
  print(Yes)
else:
  print(No)
Problem p03323 (python)

Fixed submission:
A, B = map(int, input().split())
if A <= 8 and B <= 8:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
if int(A) <= 8 and int(B) <= 8:
    print('Yay!')
if 9 <= int(A) <=16 or 9 <= int(B) <= 16: 
    print(':(')

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
if int(A) <= 8 and int(B) <= 8:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A <= 8 and B <= 8:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A <= 8 and B <= 8:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A <= 8 and B <= 8:
     print('Yay!')
else:
     print(':(')

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if (A <= 8 and B <= 8):
    print('Yay!')
else:
    print(':(')
Problem p03407 (python)

Fixed submission:
A, B, C = map(int, input().split())
if (A+B) >= C:
    print('Yes')
else:
      print('No')

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if (A+B)>=C:
print('Yes')
else:
print('No')
Problem p03043 (python)

Fixed submission:
import math
N, K = tuple(map(int, input().split()))
base = 1 / N

if N == K:
  s = base
  end = K
elif N > K:
  s = (N-K+1) / N
  end = K
else:
  s = 0
  end = N+1
for i in range(1, end):
  n = math.ceil(math.log2(K/i))
  s += base * (0.5 ** n)
print(s)

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

if N == K:
  print(base)
s = 0
for i in range(1, N+1):
  n = math.ceil(math.log2((K-1)/i))
  print(i, n)
  s += base * (0.5 ** n)
print(s)
Problem p03125 (python)

Fixed submission:
a, b = input().split()
a, b = int(a), int(b)
if b % a == 0:
  print(a+b)
else:
  print(b-a)

Buggy submission (verdict: Runtime Error):
a, b = input()
a, b = int(a), int(b)
if b % a == 0:
  print(a+b)
else:
  print(b-a)
Problem p03308 (python)

Fixed submission:
n = input()
l = input().split()
l = list(map(int, l))
max, min = max(l), min(l)
print(max-min)

Buggy submission (verdict: Runtime Error):
n = input()
l = input().split()
l = map(int, l)
max, min = max(l), min(l)
print(max - min)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if (a*b) % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a, b = input().split()
if (a*b) % 2 == 0:
  print("Even")
else:
  print("Odd")
Problem p02807 (python)

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

N = int(input())
x = list(map(int,input().split()))
mod = 10**9+7

d = [0]*(N-1)

for i in range(N-1):
    d[i] = x[i+1]-x[i]
    d[i] %= mod


kaijou = 1
for i in range(1,N):
    kaijou *= i
    kaijou %= mod


ans=0
x=0

def pow_r(x, n):
    """
    O(log n)
    """
    x %= mod
    if n == 0:  # exit case
        return 1
    if n % 2 == 0:  # standard case ① n is even
        return pow_r(x ** 2, n // 2)%mod
    else:  # standard case ② n is odd
        return (x * (pow_r(x ** 2, (n - 1) // 2)))%mod

for i in range(N-1):
    #(i+1)%(mod-2)を計算してyへ
    y = pow_r(i+1,mod-2)
    #x+= kaijou//(i+1))%(10**9+7)
    x += kaijou*y
    ans += d[i]*x
    ans %= mod

print(ans)

Buggy submission (verdict: Runtime Error):
import math
import sys 
input = sys.stdin.readline
N = int(input())
x = list(map(int,input().split()))
mod = 10**9+7

d = [0]*(N-1)
"""
for i in range(N-1):
    d[i] = x[i+1]-x[i]
    d[i] %= mod
"""

kaijou = 1
for i in range(1,N):
    i %= mod
    kaijou *= i
    kaijou %= mod

ans=0
x=0
"""
def pow_r(x, n):
    """
    O(log n)
    """
    x %= mod
    if n == 0:  # exit case
        return 1
    if n % 2 == 0:  # standard case ① n is even
        return pow_r(x ** 2, n // 2)%mod
    else:  # standard case ② n is odd
        return (x * (pow_r(x ** 2, (n - 1) // 2)))%mod

for i in range(N-1):
    #(i+1)%(mod-2)を計算してyへ
    y = pow_r(i+1,mod-2)
    #x+= kaijou//(i+1))%(10**9+7)
    x += (kaijou*y)%mod
    ans+= (d[i]*x)%mod
"""
print(ans%mod)

Buggy submission (verdict: Runtime Error):
import sys 
input = sys.stdin.readline
N = int(input())
x = list(map(int,input().split()))
mod = 10**9+7

d = [0]*(N-1)
for i in range(N-1):
    d[i] = x[i+1]-x[i]
    d[i] %= mod


kaijou = 1
for i in range(1,N):
    kaijou *= i%mod
kaijou %= mod

ans=0
x=0
"""
def pow_r(x, n):
    """
    O(log n)
    """
    x %= mod
    if n == 0:  # exit case
        return 1
    if n % 2 == 0:  # standard case ① n is even
        return pow_r(x ** 2, n // 2)%mod
    else:  # standard case ② n is odd
        return (x * (pow_r(x ** 2, (n - 1) // 2)))%mod

for i in range(N-1):
    #(i+1)%(mod-2)を計算してyへ
    y = pow_r(i+1,mod-2)
    #x+= kaijou//(i+1))%(10**9+7)
    x += (kaijou*y)%mod
    ans+= (d[i]*x)%mod
"""
print(ans%mod)

Buggy submission (verdict: Runtime Error):
import math
import sys 
input = sys.stdin.readline
N = int(input())
x = list(map(int,input().split()))

d = [0]*(N-1)
for i in range(N-1):
    d[i] = x[i+1]-x[i]
    d[i] %= 10**9+7

mod = 10**9+7
kaijou = 1
for i in range(1,N):
    kaijou *= i%mod
kaijou %= mod

ans=0
x=0

def pow_r(x, n):
    """
    O(log n)
    """
    x %= mod
    if n == 0:  # exit case
        return 1
    if n % 2 == 0:  # standard case ① n is even
        return pow_r(x ** 2, n // 2)%mod
    else:  # standard case ② n is odd
        return (x * (pow_r(x ** 2, (n - 1) // 2)))%mod

for i in range(N-1):
    #(i+1)**(10**9+5)を計算してyへ
    y = pow_r(i+1,k)
    #x+= kaijou//(i+1))%(10**9+7)
    x += (kaijou*y)%mod
    ans+= (d[i]*x)%mod

print(ans%mod)
Problem p02813 (python)

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

def kaijou(n):
    x = 1
    for i in range (1,n+1):
        x *= i
    return x

kaijou_ls = [0]*N

for i in range(N):
    kaijou_ls[i] = kaijou(i+1)

#dp
def count_order(A,k):
    if k==1:
        return 1
    else:
        B = A[N-k:]
        b = B[0]
        C = B.copy()
        C.sort()
        order = C.index(b)*kaijou_ls[k-2]

        return order+count_order(A,k-1)

print(abs(count_order(P,N)-count_order(Q,N)))

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

def kaijou(n):
    x = 1
    for i in range (1,n+1):
        x *= i
    return x

kaijou_ls = [0]*N

for i in range(N):
    kaijou_ls[i] = kaijou(i+1)

#dp
def count_order(A,k):
    if k==1:
        return 1
    else:
        B = A[N-k:]
        b = B[0]
        C = B.copy()
        C.sort()
        order = C.index(b)*kaijou_ls[k-2]

        return order+count_order(A,k-1)

print(abs(count_order(P,N)-count_order(Q,N)))
Problem p02814 (python)

Fixed submission:
from fractions import gcd
N,M = map(int,input().split())
a = list(map(int,input().split()))

def count_2(x):
    count = 0
    while x%2 == 0:
        count += 1
        x /= 2
    return count

flag = True

for i in range(N-1):
    if count_2(a[i]) != count_2(a[i+1]):
        flag = False
        break
    
if not flag:
    print(0)
    exit()

lcm=1
for i in range(N):
    lcm = lcm*a[i]//gcd(a[i],lcm)

ans=0
if lcm//2<=M:
    ans=(M-lcm//2)//lcm+1

print(ans)

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

def count_2(x):
    count = 0
    while x%2 == 0:
        count += 1
        x /= 2
    return count

flag = True

for i in range(N-1):
    if count_2(a[i]) != count_2(a[i+1]):
        flag = False
        break
    
if not flag:
    print(0)
    exit()

lcm=1
for i in range(N):
    lcm = lcm*a[i]//math.gcd(a[i],lcm)

ans=0
if lcm//2<M:
    ans=(M-lcm//2)//lcm+1

print(ans)
Problem p02900 (python)

Fixed submission:
#方針...gcd(A,B)の約数の中で素数or1となるものの個数を調べれば良い(O(route N))
import fractions
import math

def prime_fac(N):
    primes = {1:1}
    n = int(math.sqrt(N))
    for i in range(2,n+1):
        if N%i==0:
            primes[i] = 0
            while N%i==0:
                primes[i] += 1
                N = N//i
    if (N!=1):
        primes[N] = 1
    return primes

A,B = list(map(int,input().split()))
C = fractions.gcd(A,B)
primes = prime_fac(C)

print(len(primes))

Buggy submission (verdict: Runtime Error):
#方針...gcd(A,B)の約数の中で素数or1となるものの個数を調べれば良い(O(route N))
import fractions

def prime_fac(N):
    primes = {1:1}
    n = int(math.sqrt(N))
    for i in range(2,n+1):
        if N%i==0:
            primes[i] = 0
            while N%i==0:
                primes[i] += 1
                N = N//i
    if (N!=1):
        primes[N] = 1
    return primes

A,B = list(map(int,input().split()))
C = fractions.gcd(A,B)
primes = prime_fac(C)

print(len(primes))

Buggy submission (verdict: Runtime Error):
#方針...gcd(A,B)の約数の中で素数or1となるものの個数を調べれば良い(O(route N))
import math

def prime_fac(N):
    primes = {1:1}
    n = int(math.sqrt(N))
    for i in range(2,n+1):
        if N%i==0:
            primes[i] = 0
            while N%i==0:
                primes[i] += 1
                N = N//i
    if (N!=1):
        primes[N] = 1
    return primes

A,B = list(map(int,input().split()))
C = math.gcd(A,B)
primes = prime_fac(C)

print(len(primes))
Problem p03164 (python)

Fixed submission:
N, W = map(int, input().split())
w = [0]*N
v = [0]*N
for i in range(N):
    w[i], v[i] = map(int, input().split())
V = sum(v)

#dp[i][j]...i番目までの品物で価値j以上を達成するのに必要な重さの最小値(達成できないときはinf)
dp = [[float("inf")]*(V+1) for _ in range(N+1)]

"""
for j in range(V+1):
    if j<=v[0]:
        dp[1][j] = w[0]
"""
dp[0][0]=0
for i in range(1,N+1):
    for j in range(V+1):
        if j<v[i-1]:
            dp[i][j] = min(dp[i-1][j],w[i-1])
        else:
            dp[i][j] = min(dp[i-1][j],dp[i-1][j-v[i-1]]+w[i-1])

ans=0
#print(dp[-1])
for j in range(V+1):
    for i in range(N+1):
        if dp[i][j] <= W:
            ans = max(ans,j)
            break

print(ans)

Buggy submission (verdict: Runtime Error):
N, W = map(int, input().split())
w = [0]*N
v = [0]*N
for i in range(N):
    w[i], v[i] = map(int, input().split())
V = sum(v)

#dp[i][j]...i番目までの品物で価値j以上を達成するのに必要な重さの最小値(達成できないときはinf)
dp = [[float("inf")]*(V+1) for _ in range(N+1)]

for j in range(1,V+1):
    if j<=v[0]:
        dp[1][j] = w[0]

for i in range(2,N+1):
    for j in range(V+1):
        if j<v[i-1]:
            dp[i][j] = dp[i-1][j]
        else:
            dp[i][j] = min(dp[i-1][j],dp[i-1][j-v[i-1]+w[i-1]])

ans=0
#print(dp)
for i in range(N+1):
    for j in range(V+1):
        if dp[i][j] <= W:
            ans = j
            break

print(ans)
Problem p02861 (python)

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

for i in range(N):
    for j in range(i,N):
        length = ((abs(Mylist[i][1]-Mylist[j][1]))**2 + (abs(Mylist[i][0]-Mylist[j][0]))**2)**(1/2)
        ANSlist.append(length)

way = N*(N-1)
anotherway = 2*(N-1)
print(anotherway*sum(ANSlist)/way)

Buggy submission (verdict: Runtime Error):
N = int(input())
Mylist = []
ANSlist = []
for i in range(N):
    a, b = map(int, input())
    Mylist.append([a,b])

for i in range(N):
    for j in range(i,j):
        length = ((abs(Mylist[i][1]-Mylist[j][1]))**2 + (abs(Mylist[i][0]-Mylist[j][0]))**2)**1/2
        ANSlist.append(length)

print(sum(ANSlist)/len(ANSlist))
Problem p03402 (python)

Fixed submission:
a,b=map(int,input().split())
s=[["#" for i in range(100)] for j in range(50)]
t=[["." for i in range(100)] for j in range(50)]

a2,a3=(a-1)//50,(a-1)%50
for i in range(0,2*a2,2):
    for j in range(0,100,2):
        s[i][j]="."
for i in range(0,2*a3,2):
    s[2*a2][i]="."

b2,b3=(b-1)//50,(b-1)%50
for i in range(2,2*b2+2,2):
    for j in range(0,100,2):
        t[i][j]="#"
for i in range(0,2*b3,2):
        t[2*b2+2][i]="#"
print(100,100)
for i in range(50):
    print("".join(s[i]))
for i in range(50):
    print("".join(t[i]))

Buggy submission (verdict: Runtime Error):
for i in range(0,2*b2,2):
    for j in range(0,100,2):
        t[i][j]="#"
for i in range(0,2*b3,2):
        t[2*b2][i]="#"
print(100,100)
for i in range(50):
    print("".join(s[i]))
for i in range(50):
    print("".join(t[i]))
Problem p03423 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input()
print(int(n//3))
Problem p03425 (python)

Fixed submission:
import sys
n=int(input())
s=[input()[0] for i in range(n)]
m,a,r,c,h=0,0,0,0,0
for i in range(n):
    if s[i]=="M": m+=1
    elif s[i]=="A": a+=1
    elif s[i]=="R": r+=1
    elif s[i]=="C": c+=1
    elif s[i]=="H": h+=1
t=sorted([m,a,r,c,h])
q,w,e,r,u=0,0,0,0,0
if t[2]==0:
    print(0)
    sys.exit()
if t[1]==0:
    print(t[2]*t[3]*t[4])
    sys.exit()
if t[0]==0:
    q,w,e,r=t[1],t[2],t[3],t[4]
    print(q*w*e+q*w*r+q*e*r+w*e*r)
    sys.exit()
else:
    q,w,e,r,u=t[0],t[1],t[2],t[3],t[4]
    x=q*w*e+q*w*r+q*w*u+q*e*r+q*e*u+q*r*u
    y=w*e*r+w*e*u+w*r*u+e*r*u
    print(x+y)

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
s=[input()[0] for i in range(n)]
m,a,r,c,h=0,0,0,0,0
for i in range(n):
    if s[i]=="M": m+=1
    elif s[i]=="A": a+=1
    elif s[i]=="R": r+=1
    elif s[i]=="C": c+=1
    elif s[i]=="H": h+=1
t=sorted([m,a,r,c,h])
if t[2]==0:
    print(0)
    sys.exit()
if t[1]==0:
    print(t[2]*t[3]*t[4])
    sys.exit()
if t[0]==0:
    t[1],t[2],t[3],t[4]=a,b,c,d
    print(a*b*c+a*b*d+a*c*d+b*c*d)
    sys.exit()
else:
    t[0],t[1],t[2],t[3],t[4]=a,b,c,d,e
    x=a*b*c+a*b*d+a*b*e+a*c*d+a*c*e+a*d*e
    y=b*c*d+b*c*e+b*d*e+c*d*e
    print(x+y)
Problem p03427 (python)

Fixed submission:
n=int(input())
if n<10:
  print(n)
else:
  L=list(map(int, list(str(n))))
  if(L.count(9)==len(L)) or (L[0]!=9 and L.count(9)==len(L) -1):
    print(sum(L))
  else :
    print(9*(len(L)-1)+int(L[0])-1)

Buggy submission (verdict: Runtime Error):
if n<10:
  print(n)
else:
  L=list(map(int, list(str(n))))
  if(L.count(9)==len(L)) or (L[0]!=9 and L.count(9)==len(L) -1):
    print(sum(L))
  else :
    print(9*(len(L)-1)+int(L[0])-1)

Buggy submission (verdict: Runtime Error):
n=int(input())
if N<10:
  print(n)
else:
  L=list(map(int, list(str(N))))
  if(L.count(9)==len(L)) or (L[0]!=9 and L.count(9)==len(L) -1):
    print(sum(L))
  else :
    print(9*(len(L)-1)+int(L[0])-1)
Problem p03433 (python)

Fixed submission:
n=int(input())
a=int(input())
if n<500:
    if a<n:
        print("No")
    else:
        print("Yes")
else:
    m=n%500
    if a<m:
        print("No")
    else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(map(int,input().split()))
s=sorted(s)
s.reverse()
sum=0
for i in range(n):
    if i%2==0:
        sum+=s[i]
    else:
        sum-=s[i]
print(int(sum))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[int(input()) for k in range(n)]
s.sort()
s.reverse()
sum=0
for i in range(n):
    if i%2==0:
        sum+=s[i]
    else:
        sum-=s[i]
print(int(sum))
Problem p03434 (python)

Fixed submission:
n=int(input())
s=list(map(int,input().split()))
s=sorted(s)
s.reverse()
sum=0
for i in range(n):
    if i%2==0:
        sum+=s[i]
    else:
        sum-=s[i]
print(int(sum))

Buggy submission (verdict: Runtime Error):
n=int(input())
aaa=[input().split() for i in range(n)]
s=map(int,aaa)
s.reverse()
sum=0
for i in range(n):
    if i%2==0:
        sum+=s[i]
    else:
        sum-=s[i]
print(int(sum))
Problem p03435 (python)

Fixed submission:
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
c31,c32,c33=map(int,input().split())
if (c11-c12==c21-c22==c31-c32 and c12-c13==c22-c23==c32-c33 \
and c13-c11==c23-c21==c33-c31 and c11-c21==c12-c22==c13-c23 \
and c21-c31==c22-c32==c23-c33 and c31-c11==c32-c12==c33-c13) :
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
c31,c32,c33=map(int,input().split())
if (c11-c12==c21-c22==c31-c32 and c12-c13==c22-c23==c32-c33 and c13-c11==c23-c21==c33-c31 and c11-c21==c12-c22==c13-c23 and c21-c31==c22-c32==c23-c33 and c31-c11==c32-c12==c33-c13:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
c31,c32,c33=map(int,input().split())
if (c11-c12==c21-c22==c31-c32 and c12-c13==c22-c23==c32-c33 and c13-c11==c23-c21==c33-c31 and c11-c21==c12-c22==c13-c23 and c21-c31==c22-c32==c23-c33 and c31-c11==c32-c12==c33-c13 :
    print("Yes")
else:
    print("No")
Problem p03456 (python)

Fixed submission:
a,b=map(str,input().split())
n=int(a+b)
if int(n**(1/2))**2==n:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b=map(str,input().split())
n=int(a+b)
if int(n**(1/2)**2==n:
    print("Yes")
else:
    print("No")
Problem p03485 (python)

Fixed submission:
import math

a,b = list(map(int, input().split()))

c = a + b
d = c/2

x = math.ceil(d)

print(x)

Buggy submission (verdict: Runtime Error):
import math

a,b = list(map(int, input().split()))

c = a + b
d = c/2

x = ceil(d)

print(x)
Problem p03486 (python)

Fixed submission:
s=input()
t=input()
s="".join(sorted(list(s)))
t="".join(sorted(list(t))[::-1])
if s<t:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys
s=input()
t=input()
s=sorted(list(s))
t=sorted(list(t))[::-1]
sum=0
for i in range(len(s)):
    if ord(s[i])<ord(t[i]):
        print("Yes")
        sys.exit()
print("No")

Buggy submission (verdict: Runtime Error):
import sys
s=input()
t=input()
s=sorted(list(s))
t=sorted(list(t))[::-1]
sum=0
for i in range(len(s)):
    if chr(s[i])<chr(s[t]):
        print("Yes")
        sys.exit()
print("No")
Problem p03493 (python)

Fixed submission:
s = input()
 
print(int(s[0])+int(s[1])+int(s[2]))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=0
a_max=max(a)
a_min=min(a)
if a_min>=0:
    adding=a_max
elif a_min<0 and a_max>0:
    if abs(a_max)>=abs(a_min):
        adding=a_max
    else:
        adding=a_min
else:
    adding=a_min
ind=a.index(adding)
proc=[]
for i in range(n):
    ans+=1
    a[i]+=adding
    proc.append([ind+1,i+1])
for i in range(n-1):
    ans+=1
    a[i+1]+=a[i]
    proc.append([i+1,i+2])
print(ans)
for i in range(len(proc)):
    print(proc[i][0],proc[i][1])

Buggy submission (verdict: Runtime Error):
s = input()
2. 
3.# sを分解して1の数をカウントする
4.print(s.count('1'))

Buggy submission (verdict: Runtime Error):

1.# -*- coding: utf-8 -*-
2."""
3.Created on Wed Dec 20 11:35:39 2017
4. 
5.@author: kotania
6."""
7. 
8.s = input()
9. 
10.print(int(s[0])+int(s[1])+int(s[2]))

Buggy submission (verdict: Runtime Error):
ggg
Problem p03501 (python)

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

v_fee = N*A
f_fee = B
 
data = [v_fee , f_fee]
dmin = min(data)
 
print(dmin)

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

v_fee=N*A
f_fee=B

data=[v_fee, f_fee]
dmin=min(data)

print(dmin)
Problem p03502 (python)

Fixed submission:
N=int(input())
def digitsum(N) :
  s = str(N)
  array = list(map(int, list(s)))
  T = sum(array) 
  return T

U = digitsum(N)

if N % U ==0 :
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
xs=input()
xi=int(xs)
xs=list(xs)
fx=sum(xs)
print("Yes" if xi%fx==0 else "No")

Buggy submission (verdict: Runtime Error):
N=input()
def digitsum(N) :
  s = str(N)
  array = list(map(int, list(s)))
  T = sum(array) 
  return T

U = digitsum(N)

if N % U ==0 :
  print("Yes")
else:
  print("No")
Problem p03544 (python)

Fixed submission:
n=int(input())
L=[2,1]
for i in range(n-1):
    Lu=L[-1]+L[-2]
    L.append(Lu)
print(L[-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
L=[2,1]
for i in range(n-1):
    Lu=L[-1]+L[-2]
    L.append(Lu)
print(Lu[-1])
Problem p03547 (python)

Fixed submission:
x,y=map(str,input().split())
x=int(x,16)
y=int(y,16)
if x<y:
    print("<")
elif x==y:
    print("=")
else:
    print(">")

Buggy submission (verdict: Runtime Error):
x,y=map(str,input().split())
x=int(x,16)
y=int(y,16)
if x<y:
    print(<)
elif x==y:
    print(=)
else:
    print(>)

Buggy submission (verdict: Runtime Error):
x,y=map(str,input().split())
x=int(x,16)
y=int(y,16)
if int(x)<int(y):
    print(<)
elif x==y:
    print(=)
else:
    print(>)

Buggy submission (verdict: Runtime Error):
x,y=map(str,input().split())
"A"="1"
"B"="2"
"C"="3"
"D"="4"
"E"="5"
"F"="6"
if int(x)<int(y):
    print(<)
elif x==y:
    print(=)
else:
    print(>)

Buggy submission (verdict: Runtime Error):
[X,Y]=input().split()
2.if X > Y:
3.    print(">")
4.elif X==Y:
5.    print("=")
6.else:
7.    print("<")

Buggy submission (verdict: Runtime Error):
if
Problem p03548 (python)

Fixed submission:
x,y,z=map(int,input().split())
i,sum=0,0
while True:
    sum+=y+z
    i+=1
    if sum>x-z:
        print(i-1)
        break

Buggy submission (verdict: Runtime Error):
jj
Problem p03549 (python)

Fixed submission:
n,m = map(int,input().split())
print((1900*m+100*(n-m))*2**m)

Buggy submission (verdict: Runtime Error):
asdfghjkl;
Problem p03555 (python)

Fixed submission:
a=input()
b=input()
if a==b[::-1]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
if a==b.reverse():
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
c11,c12,c13=map(str,input().split())
c21,c22,c23=map(str,input().split())
if c11==c23 and c12==c22 and c13==c21:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
if c11==c23 and c12==c22 and c13==c21:
    print("YES")
else:
    print("NO")
Problem p03565 (python)

Fixed submission:
s=input()
t=input()
n=len(s)-len(t)+1
lst=[]
for i in range(n):
    tot=0
    ss=s
    for j in range(len(t)):
        if ss[i+j]==t[j] or ss[i+j]=="?":
            tot+=1
    if tot==len(t):
        ss=list(ss)
        t=list(t)
        for j in range(len(t)):
            ss[i+j]=t[j]
        ss="".join(ss)
        t="".join(t)
        ss=ss.replace("?","a")
        lst.append(ss)
lst.sort()
print(lst[0] if len(lst)!=0 else "UNRESTORABLE" )

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
n=len(s)-len(t)+1
lst=[]
for i in range(n):
    tot=0
    ss=s
    for j in range(len(t)):
        if ss[i+j]==t[j] or ss[i+j]=="?":
            tot+=1
    if tot==len(t):
        for j in range(len(t)):
            ss[i+j]=t[j]
        ss=ss.replace("?","a")
        lst.append(ss)
lst.sort()
print(lst[0] if len(lst)!=0 else "UNRESTORABLE" )
Problem p03574 (python)

Fixed submission:
h,w=map(int,input().split())
a=""
for i in range(w+2):
    a=a+"a"
S=[a]
for i in range(h):
    S.append("a"+input()+"a")
S.append(a)
for i in range(1,h+1):
    for j in range(1,w+1):
        if S[i][j]==".":
            num=0
            for u in range(-1,2):
                for v in range(-1,2):
                    if S[i+u][j+v]=="#":
                        num+=1
            S[i]=S[i][:j]+str(num)+S[i][j+1:]
for i in range(1,h+1):
    print(S[i][1:w+1])

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
a=""
for i in range(w+2):
    a=a+"a"
S=[a]
for i in range(h):
    S.append("a"+input()+"a")
S.append(a)
for i in range(1,h+1):
    for j in range(1,w+1):
        if S[i][j]==".":
            num=0
            for u in range(-1,2):
                for v in range(-1,2):
                    if S[i+u][j+v]=="#":
                        num+=1
            S[i]=S[i][:j-1]+str(num)+S[i][:j+1]
for i in range(1,h+1):
    print(S[i][1:w+1])
Problem p03597 (python)

Fixed submission:
n,a=(int(input()) for i in range(2))
print(n**2-a)

Buggy submission (verdict: Runtime Error):
n,a=(int(input() for i in range(2))
print(n**2-a)