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

Fixed submission:
S = input()

T = input()
count = 0

s=[]
t=[]
for i in S:
    s.append(i)
for j in T:
    t.append(j)


if s[0]==t[0]:
    count+=1
if s[1]==t[1]:
    count+=1
if s[2]==t[2]:
    count+=1

print(str(count))

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

count=0
sum=1
while(sum<b):
    sum+=a-1
    count+=1
print(count)

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

for B in range(1,21):

    if B==1 and a>=2:
        lim=B*a
    elif B>1 and a>=2:
        lim=(B-1)*(a-1)+a

    if lim>=b:
        break
print(B)

Buggy submission (verdict: Runtime Error):
a, b, c = (i for i in input().split())

d, e, f = (i for i in input().split())

count = 0
if a==d:
    count+=1
elif d==e:
    count+=1
elif c==f:
    count+=1
print(str(count))
Problem p02934 (python)

Fixed submission:
N = int(input())

num = map(int,input().split())
sum = 0
for i in num:

    sum += 1/i

answer = 1 / sum

print(answer)

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

num = [int(input()) for i in range(N)]

for i in num:

    sum = 1/i

answer = 1 / sum

print(int(answer))
Problem p04047 (python)

Fixed submission:
N = [int(v) for v in input().split()]
L = [int(v) for v in input().split()]
L.sort()
L_even=L[0::2]
goukei=sum(L_even)
print(str(goukei))

Buggy submission (verdict: Runtime Error):
N = int(input())
L =[]
for i in range(N*2):
    guzai=int(input())
    L.append(guzai)

L.sort()
L_even=L[0::2]
goukei=sum(L_even)
print(str(goukei))

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

guzai=int(input())
L.append(guzai)

L.sort()
L_even=L[0::2]
goukei=sum(L_even)
print(str(goukei))
Problem p02657 (python)

Fixed submission:
#intの場合
L,R = map(int,input().split())

ans = L*R
print(ans)

Buggy submission (verdict: Runtime Error):
#intの場合
N = int(input()) #ここで標準入力

#List にしたい時
#intの場合
huga = list(map(long, input().split()))
ans = 1
flg = 0
for number in huga:
    ans = ans * number
    if ans > 10**18:
        flg = 1
        break

if flg == 0:
    print(ans)
else:
    print('-1')
Problem p02658 (python)

Fixed submission:
#intの場合
N = int(input()) #ここで標準入力

#List にしたい時
#intの場合
huga = list(map(int, input().split()))
if 0 in huga:
    print(0)
else:
    ans = 1
    flg = 0
    for number in huga:
        ans = ans * number
        if ans > 10**18:
            flg = 1
            break
    if flg == 0:
        print(ans)
    else:
        print('-1')

Buggy submission (verdict: Runtime Error):
#intの場合
N = int(input()) #ここで標準入力
print (type(N),N) 
#<class 'int'> 20

#List にしたい時
#intの場合
huga = list(map(int, input().split()))
print(type(huga),huga)
# <class 'list'> [12, 34]
print(type(huga[0]),huga[0])
# <class 'int'> 12

ans = 1

for int i in huga:
    ans = ans * i

print(ans)
Problem p03480 (python)

Fixed submission:
s = list(input())
n = len(s)
if n % 2 == 0:
    for i in range(n//2):
        a = s[n // 2]
        if s[n // 2 - 1 - i] != a or s[n // 2 + i] != a:
            print(n // 2 + i)
            exit()
else:
    for i in range(1, (n - 1) // 2 + 1):
        b = s[(n-1)//2]
        if s[(n - 1) // 2 - i] != b or s[(n - 1) // 2 + i] != b:
            print((n-1)//2+i)
            exit()
print(n)

Buggy submission (verdict: Runtime Error):
s = list(input())
n = len(s)
ans = 1
# 区間は2以上の長さ
if n % 2 != 0:
    for i in range(1, n):
        a = s[n // 2]
        if s[n // 2 - 1 - i] != a or s[n // 2 + i] != a:
            print(n // 2 + i)
            exit()
else:
    for i in range(1, (n - 1) // 2 + 1):
        b = s[(n-1)//2]
        if s[(n - 1) // 2 - i] != b or s[(n - 1) // 2 + i] != b:
            print((n-1)//2+i)
            exit()
print(n)

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s)
# 区間は2以上の長さ
if n % 2 != 0:
    for i in range(1, n):
        a = s[n // 2]
        if s[n // 2 - 1 - i] != a or s[n // 2 + i] != a:
            print(n // 2 + i)
            exit()
else:
    for i in range(1, (n - 1) // 2 + 1):
        b = s[(n-1)//2]
        if s[(n-1)//2-i] != b or s[(n-1)//2+i] != b:
            print((n - 1) / 2 + i)
            exit()
print(n)

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s)
ans = 1
# 区間は2以上の長さ
if n % 2 != 0:
    for i in range(1, n):
        a = s[n // 2]
        if s[n // 2 - 1 - i] != a or s[n // 2 + i] != a:
            print(n // 2 + i)
            exit()

else:
    for i in range(1, (n - 1) // 2 + 1):
        b = s[(n-1)//2]
        if s[(n-1)//2-i] != b or s[(n-1)//2+i] != b:
            print((n - 1) / 2 + i)
            exit()
Problem p02714 (python)

Fixed submission:
from sys import stdin
n = int(input())
s = stdin.readline()
r = 0
g = 0 
b = 0
for i in range(n):
    if s[i] == "R":
        r += 1
    elif s[i] == "G":
        g += 1
    else:
        b += 1
count1 = r*g*b
count2 = 0
for i in range(0,n-2):
    for j in range(i+1,n-1):
        if 2*j-i<=n-1:
            if (s[i] != s[j])and(s[i] != s[2*j-i])and(s[j] != s[2*j-i]):
               count2 += 1
print(count1-count2)

Buggy submission (verdict: Runtime Error):
from sys import stdin
n = int(input())
s = stdin.readline()
rind = []
gind = []
bind = []
ans = 0
for i in range(n):
    if s[i] == "R":
        rind.append(i+1)
    elif s[i] == "G":
        gind.append(i+1)
    else:
        bind.append(i+1)
for i in range(len(rind)):
    for j in range(len(gind)):
        for k in range(len(bind)):
            if (rind[i]+gind[j]!=2*bind[k])and(gind[j]+bind[k]!=rind[i])and(bind[k]+rind[i]!=gin[j]):
                ans += 1
print(ans)
Problem p03160 (python)

Fixed submission:
size=int(input())
h = list(map(int,input().split()))
dp = [0 for _ in range(size)]
for i in range(1,size):
    if i == 1:
        dp[i] = dp[0]+abs(h[0]-h[1])
    else:
        a = dp[i-2]+abs(h[i-2]-h[i])
        b = dp[i-1]+abs(h[i-1]-h[i])
        if a < b:
            dp[i] = a
        else:
            dp[i] = b
print(dp[-1])

Buggy submission (verdict: Runtime Error):
size=int(input())
h = list(map(int,input().split()))
dp = 0
i = 0
while i != size:
  if i == size-1:
    dp += abs(h[i]-h[i+1])
    i = i+1
  else:
    if abs(h[i]-h[i+1]) < abs(h[i]-h[i+2]):
      dp += abs(h[i]-h[i+1])
      i = i+1
    else:
      dp += abs(h[i]-h[i+2])
      i = i+2
print(dp)

Buggy submission (verdict: Runtime Error):
size=int(input())
h = list(map(int,input().split()))
dp = 0
for i in range(0, size):
    if i < size-1:
        if abs(h[i]-h[i+1]) < abs(h[i]-h[i+2]):
            dp += abs(h[i+1]-h[i])
        else:
            dp += abs(h[i+2]-h[i])
    if i = size-1:
        dp += abs(h[i+1]-h[i])
print(dp)

Buggy submission (verdict: Runtime Error):
size=int(input())
h = list(map(int,input().split()))
dp = 0
for i in range(0, size):
    if i < size-1:
        if abs(h[i]-h[i+1]) < abs(h[i]-h[i+2]):
            dp += abs(h[i+1]-h[i])
        else:
            dp += abs(h[i+2]-h[i])
    if i = size-1:
        dp += abs(h[i+1]-h[i])
    except:
        pass
print(dp)

Buggy submission (verdict: Runtime Error):
size=int(input())
h = list(map(int,input().split()))
dp = 0
for i in range(0, size):
    if i < size-1:
        if abs(h[i]-h[i+1]) < abs(h[i]-h[i+2]):
            dp += abs(h[i+1]-h[i])
        else:
            dp += abs(h[i+2]-h[i])
    if i = size-1:
        dp += abs(h[i+2]-h[i])
    except:
        pass
print(dp)

Buggy submission (verdict: Runtime Error):
size=int(input())
h = list(map(int,input().split()))
dp = 0
for i in range(0, size):
  	try:
    	if abs(h[i]-h[i+1]) < abs(h[i]-h[i+2]):
			dp += abs(h[i]-h[i+1])
  		else:
      		dp += abs(h[i]-h[i+2])
  	except:
    	pass
print(dp)
Problem p02657 (python)

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

print(int(a)*int(b))

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

print(a*b)

Buggy submission (verdict: Runtime Error):
a, b = int(input())

print(a*b)
Problem p02768 (python)

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


def mod_comb_k(n, k):
    n_P_n_k = 1
    fact_k = 1
    for i in range(k):
        n_P_n_k = n_P_n_k * (n - i) % M
        fact_k = fact_k * (i + 1) % M
    return n_P_n_k * pow(fact_k, M-2, M)

ans = (pow(2, N, M) - 1 - mod_comb_k(N, a) - mod_comb_k(N, b)) % M
print(ans)

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

m = N//2 + 1
fact_list = [1] * (N+1)
fact_inv = [1] * (N+1)

for i in range(1, N+1):
    fact_list[i] = fact_list[i-1] * i % M

for i in range(1, N+1):
    fact_inv[i] = pow(int(fact_list[i]), M-2, M)

def mod_comb_k(n,k,M):
    return int(fact_list[n]) * int(fact_inv[k]) % M * int(fact_inv[n-k]) % M

ans = 0
for i in range(1, N+1):
    if i == a or i == b:
        continue
    ans += mod_comb_k(N, i, M) % M
    # print(ans)
print(ans)

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

m = N//2 + 1
fact_list = [1] * (N+1)
fact_inv = [1] * (N+1)

for i in range(1, N+1):
    fact_list[i] = fact_list[i-1] * i % M

for i in range(1, N+1):
    fact_inv[i] = pow(int(fact_list[i]), M-2, M)

def mod_comb_k(n,k,M):
    return int(fact_list[n]) * int(fact_inv[k]) % M * int(fact_inv[n-k]) % M

ans = 0
for i in range(1, N+1):
    if i == a or i == b:
        continue
    ans += mod_comb_k(N, i, M) % M
    # print(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, a, b = map(int, input().split())
M = 1000000007

m = N//2 + 1
fact_list = np.ones(N+1, dtype='int32')
fact_inv = np.ones(N+1, dtype='int32')

for i in range(1, N+1):
    fact_list[i] = fact_list[i-1] * i % M

for i in range(1, N+1):
    fact_inv[i] = pow(int(fact_list[i]), M-2, M)

def mod_comb_k(n,k,M):
    return int(fact_list[n]) * int(fact_inv[k]) % M * int(fact_inv[n-k]) % M

ans = 0
for i in range(1, N+1):
    if i == a or i == b:
        continue
    ans += mod_comb_k(N, i, M) % M
    # print(ans)
print(ans)
Problem p02924 (python)

Fixed submission:
n = int(input())
print((n-1 + 1) * (n-1) // 2)

Buggy submission (verdict: Runtime Error):
n = int(input())
print(sum(list(range(n))))
Problem p03139 (python)

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

print(min(a,b),max(a+b-n,0))

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

print(min(a,b),max(a+b-n,0))
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 =int(input()) 
b= int(input())
if a <= 8 and b <= 8:
    print('Yay!')
else:
    print(':(')
Problem p03331 (python)

Fixed submission:
N = sum([int(i) for i in input()])
print('10' if N == 1 else N)

Buggy submission (verdict: Runtime Error):
N = int(input())
LR = [tuple(map(int,input().split()))for i in [None] * N]
Lmin = sorted(LR,key=lambda x:x[0])
Rmax = sorted(LR,key=lambda x:x[1],reverse=True)

T = 0
def t_len(lr):
    a = lr[1] - T
    b = T - lr[0]
    return  a if a > b else b

def select(l):
    return sorted(l,key=t_len,reverse=True)[0]

def select2(l):
    a = abs(Lmin[0][0] - T)
    b = abs(Rmax[0][1] - T)
    return Lmin[0] if a > b else Rmax[0]

def selectT(lr):
    if lr[0] <= T <= lr[1]:
        return T
    a = lr[1] - T
    b = T - lr[0]
    return  lr[0] if a > b else lr[1]
K = 0
for i in [None]*N:
    s = select2(LR)
    nextT = selectT(s)
    K += abs(nextT-T)
    T = nextT
    LR.remove(s)
    Lmin.remove(s)
    Rmax.remove(s)
K += abs(T)
print(K)
Problem p03342 (python)

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

result = 0
Right = 0
tmp = 0
for left in range(N):
    for right in range(Right,N):
        if not (tmp & A[right]):
            tmp += A[right]
            Right = right + 1
        else:
            break
    tmp -= A[left]
    result += Right - left
print(result)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = tuple(map(int,input().split()))

R = N
L = np.zeros((N,N), dtype='bool')
L[0,:] = 1
for i in range(1,N):
    t = 0
    L[i,:] = np.array( [L[i-1][j] and L[i-1][j+1] and A[j]^A[i+j] == A[j]+A[i+j] for j in range(N-i)] + [False]*(i) )
    t = L[i].sum()
    R += t
    if t == 0:
        break
print(R)

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

R = 0
L = tuple()
for i in range(N):
    if i == 0:
        L = (True,) * N
    else:
        L = (L[j] and A[j]^A[i+j] == A[j]+A[i+j] and L[j+1] for j in range(N-i)) + (False,) * i 
    R += sum(L)
    if sum(L) == 0:
        break
print(R)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = tuple(map(int,input().split()))
R = 0
L = tuple()
for i in range(N):
    if i == 0:
        L = (True,) * N
    else:
        L = (L[j] and A[j]^A[i+j] == A[j]+A[i+j] and L[j+1] for j in range(N-i)) + (False,) * i 
    R += sum(L)
    if sum(L) == 0:
        break
print(R)
Problem p03355 (python)

Fixed submission:
s = input()
K = int(input()) # 1 <= K <= 5

alpha = "abcdefghijklmnopqrstuvwxyz"
substring = ''
L = []
for i in alpha:
    indeces = [key for key, x in enumerate(s) if x == i]
    for j in indeces:
        for k in range(j,j+K):
            substring += s[j:k+1] + ','
    L += substring.split(',')[:-1] 
    if len(set(L)) >= K:
        break
    substring = ""
print(sorted(set(L))[K-1])

Buggy submission (verdict: Runtime Error):
s = input()
print(sorted(set([s[i:j+1] for i in range(len(s)) for j in range(i,len(s))]))[int(input())-1])
Problem p03550 (python)

Fixed submission:
N,Z,W = map(int,input().split())
a = list(map(int,input().split())) 
alast = a[N-1]
if N == 1:
    print(abs(W-alast))
    exit()
print(max(abs(W-alast),abs(a[N-2]-alast)))

Buggy submission (verdict: Runtime Error):
N,Z,W = map(int,input().split())
a = list(map(int,input().split()))
amax = max(*a,Z,W)
amin = min(*a,Z,W)
alast = a[N-1]
if N == 1:
    print(abs(W-a[0]))
    exit()
print(max(amax-alast,amin-alast))
Problem p03780 (python)

Fixed submission:
N,K = map(int,input().split())
a = sorted(map(int,input().split()))

count = N
s = 0
for i in range(N-1,-1,-1):
    if s + a[i] < K:
        s += a[i]
    else:
        count = min(i,count)
print(count)

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

count = N
s = 0
for i in range(N-1,-1,-1):
    if s + N[i] < K:
        s += N[i]
    else:
        count = min(i,count)
print(count)

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

dp1 = [[False]*K for _ in range(N)]
dp2 = [[False]*K for _ in range(N)]
# dp[x][y] x枚目まで使った時にyに出来るか
# K-ai <= ai < K となる部分集合を探す

dp1[0][a[0]] = True
dp1[0][0] = True
for i in range(1,N):
    for j in range(K):
        dp1[i][j] = dp1[i-1][j] or (j-a[i] >= 0 and dp1[i-1][j-a[i]])

dp2[0][a[N-1]] = True
dp2[0][0] = True
for i in range(1,N):
    for j in range(K):
        dp2[i][j] = dp2[i-1][j] or (j-a[N-i-1] >= 0 and dp2[i-1][j-a[N-i-1]])
count = 0
for i in range(N):
    if K-a[i] <= 0:
        count += 1
        continue
    for j in range(K-a[i],K):
        f = False
        if i == 0:
            if dp2[N-2][j]:
                count += 1
                break
            else:
                continue
        elif i == N-1:
            if dp1[N-2][j]:
                count += 1
                break
            else:
                continue
        for k in range(j+1):
            if dp1[i-1][k] and dp2[N-i-2][j-k]:
                count += 1
                f = True
                break
        if f:
            break
print(N-count)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
a = list(map(int,input().split()))
a_sum = sum(a)
if a_sum < K:
    print(N)
    exit()
if a_sum == K:
    print(0)
    exit()
count = 0
L = [i for i in a if i < K]
L_sum = sum(L)
if L_sum < K:
    print(len(K))
    exit()
if L_sum == K:
    print(0)
    exit()
for i in L:
    if L_sum - i >= K:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
a = list(map(int,input().split()))
a_sum = sum(a)
if a_sum < K:
    print(N)
    exit()
if a_sum == K:
    print(0)
    exit()
count = 0
L = [i for i in a if i < K]
L_sum = sum(L)
if L_sum < K:
    print(len(N))
    exit()
if a_sum == K:
    print(0)
    exit()
for i in L:
    if L_sum - i >= K:
        count += 1
print(count)
Problem p02657 (python)

Fixed submission:
in_d = input()

a, b = in_d.split()
a = int(a)
b = int(b)

c = a * b
print(c)

Buggy submission (verdict: Runtime Error):

in_d = input()
n = int(in_d)

a = [int(i) for i in input().split()]

result = 0
if 0 in a:
    print(0)
else:
    result = 1
    limit = 10 ** 18
    over = 0
    a.sort()
    for v in a:
        result *= v
        if result > limit:
            over = 1
            break
    if over == 1:
        print(-1)
    else:
        print(result)
Problem p02801 (python)

Fixed submission:
import sys

args = sys.argv

a = "abcdefghijklmnopqrstuvwxyz"

c = input()
idx = a.index(c)
print(a[idx + 1])

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv

a = "abcdefghijklmnopqrstuvwxyz"

c = args[1]
idx = a.index(c)
print(a[idx + 1])
Problem p02717 (python)

Fixed submission:
x,y,z = input().split()
x,y = int(y),int(x)
x,z = int(z),int(x)
print(x,y,z)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))
tot_votes = sum(A)
count = 0
for a in A:
    if(a>=tot_votes/(4*M)):
        count+=1
if(count>=M):
    print("Yes")
else:
    print("No")
Problem p02718 (python)

Fixed submission:
N,M = map(int,input().split())
A = list(map(int,input().split()))
tot_votes = sum(A)
count = 0
for a in A:
    if(a>=tot_votes/(4*M)):
        count+=1
if(count>=M):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,M = input().split()
A = list(map(int,input().split()))
tv = sum(A)
i,count=0,0
while(i<N and count!=M):
  if(A[i]>int(tv/4*int(M))):
    count+=1
if(count==M):
  print("YES")
else:
  print("NO")
Problem p02658 (python)

Fixed submission:

n = int(input())
a = list(input().split(' '))
# print(n, a)
def doit(n,a):
  m = 1
  for i in range(n):
    m = m*int(a[i])
    if m > 1000000000000000000:
        for y in range(i+1, n):
            if a[y] == '0':
                return 0
        return -1
    elif m==0:
        return 0

#   if m > 1000000000000000000:
#     return -1
  return m
 
print(doit(n,a))

Buggy submission (verdict: Runtime Error):
n = input()
a = input().split(' ')
def doit(a):
  m = 1
  for ai in a:
  	if m > 10**18:
      return -1
    m = m*a
  
  return m

doit(a)
Problem p02687 (python)

Fixed submission:
in_ = input()
if in_ == 'ABC':
  print('ARC')
else:
  print('ABC')

Buggy submission (verdict: Runtime Error):
in = input()
if in == 'ABC':
  print('ARC')
else:
  print('ABC')
Problem p02696 (python)

Fixed submission:
A,B,N = map(int, input().split())
c = min(N,B)
if c % B == 0:
    print(int(A*(c-1)/B))
else :
    print(int(A*(c)/B))

Buggy submission (verdict: Runtime Error):
A,B,N = map(int, input().split(' '))
p = min(N,B)
if p%B == 0:
    print(int(A(p-1)/B))
else :
    print(int(A(p)/B))

Buggy submission (verdict: Runtime Error):
A,B,N = map(int, input().split(' '))
c = min(N,B)
if c % B == 0:
    print(int(A(c-1)/B))
else :
    print(int(A(c)/B))

Buggy submission (verdict: Runtime Error):
A,B,N = map(int, input().split(' '))
c = min(N,B)
if p % B == 0:
    print(int(A(c-1)/B))
else :
    print(int(A(c)/B))

Buggy submission (verdict: Runtime Error):

a, b, n = map(int, input().split())
p = min(b, n)
if p % b == 0:
    print( int( a(p-1)/b ))
else:
    print( int(a*p/b))

Buggy submission (verdict: Runtime Error):
import math
a, b, n = map(int, input().split())
p = min(b, n)
if p % b == 0:
    print( int( a(p-1)/b ))
else:
    print( int(a*p/b))

Buggy submission (verdict: Runtime Error):
import math
a, b, n = map(int, input().split())
p = min(b, n)
if p % b == 0:
    print(int(a(p-1)/b))
else:
    print(int((a(p))/b))

Buggy submission (verdict: Runtime Error):
import math
a, b, n = map(int, input().split())
p = min(b, n)
if p % b == 0:
    print(int(a(p-1))/b)
else:
    print(int((a(p))/b))
Problem p03962 (python)

Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

R = 0
while len(A) > 0:
    A = [a for a in A if a != A[0]]
    R += 1

print(R)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import numpy as np
from collections import deque as deq

N, K = map(int, input().split())

print(K * ((K - 1)**(N - 1)))
Problem p02921 (python)

Fixed submission:
S = input()
T = input()
count=0
for i in range(3):
  if S[i] == T[i]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
S,T=input().split()
count=0
for i in range(3):
  if S[i] == T[i]:
    count += 1
print(count)
Problem p02957 (python)

Fixed submission:
A, B = map(int, input().split())
print((A+B)//2 if (A+B)%2==0 else "IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
print((a+b)//2 if (A+B)%2==0 else "IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if ((a + b)%2) == 0:
  print (a + b)//2
else:
  print ('IMPOSSIBLE')
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3*(r**2))

Buggy submission (verdict: Runtime Error):
r = input()
return 3*(r**2)
Problem p02993 (python)

Fixed submission:
S = input()
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
  print('Bad')
else:
  print('Good')

Buggy submission (verdict: Runtime Error):
S = int(input())
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
  print('Bad')
else:
  print('Good')
Problem p03219 (python)

Fixed submission:
X, Y = map(int, input().split())
print(int(X + Y/2))

Buggy submission (verdict: Runtime Error):
n = input()
for i in [0, 1, 2]:
  if n[i] == '1':
    n[i] == '9'
  if n[i] == '9':
    n[i] == '1'
print(int(n))
Problem p03377 (python)

Fixed submission:
A, B, C = map(int, input().split())
if A == C or (A < C and B >= C - A):
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
A, B, X = (int(x) for x in input.split())
if A > X or A + B < X:
  print('No')
else:
  print('Yes')
Problem p03385 (python)

Fixed submission:
l = input()
if len([x for x in set(l) if l.count(x) > 1]) > 0:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a, b, c = input().split()
if a == 'a' and b == 'b' and c == 'c':
  print('Yes')
else:
  print('No')
Problem p03469 (python)

Fixed submission:
S = input()
print(S.replace('17', '18'))

Buggy submission (verdict: Runtime Error):
S = input()
S[:3] = '2018'
print(S)
Problem p03477 (python)

Fixed submission:
A, B, C, D = (int(x) for x in input().split())
if A + B < C + D:
  print('Right')
if A + B > C + D:
  print('Left')
if A + B == C + D:
  print('Balanced')

Buggy submission (verdict: Runtime Error):
A, B, C, D = (int(x) for x in input().split())
if A + B < C + D:
  print('Right')
else:
  if A + B > C + D:
    print('Left')
  else:
    print('Balanced)

Buggy submission (verdict: Runtime Error):
A, B, C, D = (int(x) for x in input().split())
if A + B > C + D:
  print('Right')
else:
  if A + B < C + D:
    print('Left')
  else:
    print('Balanced)
Problem p02705 (python)

Fixed submission:
import math
n = int(input())
print(round(2 * math.pi * n, 2))

Buggy submission (verdict: Runtime Error):
import math
def solve():
    n = int(input())
    print(round(2 * math.pi * n, 2))


for _ in range(int(input())):
    solve()