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

Fixed submission:
s = input()
if s.endswith('s'):
  print(s + 'es')
else:
  print(s + 's')

Buggy submission (verdict: Runtime Error):
s = input()
if s.endwith('s'):
	print(s + 'es')
else:
	print(s + 's')
Problem p02627 (python)

Fixed submission:
alpha = input()

if alpha.isupper():
  print('A')
elif alpha.islower():
  print('a')

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

j = 0
i = 0

while i <= k-1:
  j += int(new_list[i])
  i += 1

print(j)

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

new_list = sorted(li)

j = 0
i = 0

while i <= k-1:
  j += int(new_list[i])
  i += 1

print(j)

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

new_list = sorted(list)

print(new_list)

j = 0
i = 0

while i <= k-1:
  j += int(new_list[i])
  i += 1

print(j)

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

new_list = sorted(list)

j = 0
i = 0

while i <= k-1:
  j += int(new_list[i])
  i += 1

print(j)
Problem p02546 (python)

Fixed submission:
s = input()                                                                                                   
if s[-1] == 's':
    s += 'es'
else:
    s += 's'      
print(s)

Buggy submission (verdict: Runtime Error):
if s[-1] == 's':      
    s += 'es'                                                                                                 
else:      
    s += 's'      
print(s)
Problem p02594 (python)

Fixed submission:
X = int(input())
if X >= 30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if X >= 30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if x <= 30:
  print("No")
else:
  print("Yes")
Problem p02570 (python)

Fixed submission:
d,t,s = map(int, input().split())
if d/s <= t:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
d,t,s = map(int, input().split())
if t <= d/s:
  print('Yes')
 else:
  print('No')
Problem p02659 (python)

Fixed submission:
A, B = input().split()
A = int(A)
B = B.split('.')
B = int(B[0])*100 + int(B[1])
res = '{:d}'.format(A*B)[:-2]
if res == '':
	print('0')
else:
	print(res)

Buggy submission (verdict: Runtime Error):
A, B = map(float, input().split())
res = math.floor(A*B)
print(res)
Problem p02699 (python)

Fixed submission:
S, W = map(lambda x: int(x), input().split())
if S > W:
  print('safe')
else:
  print('unsafe')

Buggy submission (verdict: Runtime Error):
S, W = map(lambda x: int(x), input().split())
if S > W:
  print('safe')
  else:
    print('unsafe')

Buggy submission (verdict: Runtime Error):
S, W = map(lambda: x, input().split())
if S>W:
  print('safe')
else:
  print('unsafe')
Problem p02831 (python)

Fixed submission:
import fractions
A, B = [int(x) for x in input().split()]
lcm = (A * B) // fractions.gcd(A, B)
print(lcm)

Buggy submission (verdict: Runtime Error):
import math
A, B = [int(x) for x in input().split()]
lcm = (A * B) // math.gcd(A, B)
print(lcm)
Problem p02832 (python)

Fixed submission:
N = int(input())
a = [int(x) for x in input().split()]
# a = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3]

target = 1
res = 0
flag = False

for x in a:
	if x == target:
		target += 1
		flag = True
	else:
		res += 1

if flag:
	print(res)
else:
	print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(x) for x in input().split()]

def brickblock(lst, flag=False, target=1, res=0):
	if not lst:
		if flag:
			return res
		else:
			return -1
	elif lst[0] == target:
		return brickblock(lst[1:], True, target+1, res)
	else:
		return brickblock(lst[1:], flag, target, res+1)

res = brickblock(a)
print(res)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(x) for x in input().split()]

def brickblock(lst, acm=[], target=1, res=0):
	if len(lst) < 1:
		if len(acm)>0:
			return res
		else:
			return -1
	elif lst[0] == target:
		return brickblock(lst[1:], acm+[target], target+1, res)
	else:
		return brickblock(lst[1:], acm, target, res+1)

res = brickblock(a)
print(res)
Problem p02771 (python)

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

p.sort()

if p[0]==p[1]:
    if p[1]==p[2]:
        print('No')
    else:
        print('Yes')
elif p[1]==p[2]:
    print('Yes')
else:
    print('No')

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

s = []
t = []

for i in range(n):
    s.append(input())

s.sort()

for j in range(n):
    t.append(s.count(s[j]))

u = max(t)

st = 0

for k in range(n):
    if s.count(s[k]) == u and st != s[k]:
        print (s[k])
        st = s[k]
Problem p02550 (python)

Fixed submission:
N, X, M = [int(v) for v in input().split()]

def f(a):
    return a * a % M

a = X

map = {}
ary = [a]
map[a] = 0

sub = [0, a]
last_sub = a

count = 1
for i in range(1, N):
    a = f(a)
    if a == 0:
        break
    if a in map:
        break
    else:
        map[a] = i
    count += 1
    last_sub += a
    sub.append(last_sub)

if a == 0:
    print(sub[-1])
    exit()


def naive(a):
    total = a
    ary = [a]
    for i in range(1, N):
        a = f(a)
        ary.append(a)
    return ary
    
#n_ary = naive(X)
#print(n_ary)
#print(sum(n_ary))

j = map[a]

#print(sub)
#print(j)

unit = sub[-1] - sub[j]
#print(unit)

l = count
i = (N - j) % (l - j)
d = (N - j) // (l - j)

#i = N % l
#d = N // l

#print(len(sub), i, j)
print(unit * d + sub[i + j])

#print(sub[-1] * (d + 1) * d // 2 + sub[i])

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

def f(a):
    return a * a % M


a = X

map = {}
ary = [a]
map[a] = 1

sub = [0, a]
last_sub = a

def naive(a):
    total = a
    ary = [a]
    for i in range(1, N):
        a = f(a)
        ary.append(a)
    return ary
    
#n_ary = naive(X)
#print(n_ary)
#print(sum(n_ary))

count = 1
for i in range(1, N):
    a = f(a)
    if a == 0:
        break
    if a in map:
        break
    else:
        map[a] = i
    count += 1
    last_sub += a
    sub.append(last_sub)

if a == 0:
    print(sub[-1])
    exit()

j = map[a]

#print(sub)
#print(j)
unit = sub[-1] - sub[j]
#print(unit)

l = count
i = (N - j) % (l - j)
d = (N - j) // (l - j)

#i = N % l
#d = N // l

#print(len(sub), i, j)
print(unit * d + sub[i + j])

#print(sub[-1] * (d + 1) * d // 2 + sub[i])
Problem p02834 (python)

Fixed submission:
import heapq;

n, u, v = [int(v) for v in input().split()]

vert = []

for i in range(n):
    vert.append([])

for i in range(n - 1):
    a, b = [int(v) - 1 for v in input().split()]
    vert[a].append(b)
    vert[b].append(a)

taka = u-1
aoki = v-1

if taka == aoki:
    print(0)
    exit()

def bfs(begin):
    q = [(0, begin)]
    dist = [-1] * n
    dist[begin] = 0

    index = 0
    while index < len(q):
        c0, i = q[index]
        c = c0 + 1
        for l in vert[i]:
            if dist[l] >= 0:
                continue
            dist[l] = c
            q.append((c, l))
        index += 1
    return dist

aoki_dist = bfs(aoki)
taka_dist = bfs(taka)

ans = 0
for i in range(n):
    if taka_dist[i] < aoki_dist[i]:
        ans = max(ans, aoki_dist[i] - 1)

print(ans)

Buggy submission (verdict: Runtime Error):
import heapq;

n, u, v = [int(v) for v in input().split()]

vert = []

for i in range(n):
    vert.append([])

for i in range(n - 1):
    a, b = [int(v) - 1 for v in input().split()]
    vert[a].append(b)
    vert[b].append(a)

taka = u-1
aoki = v-1

if taka == aoki:
    return 0

q = [(0, aoki)]
aoki_dist = [-1] * n
aoki_dist[aoki] = 0

index = 0
while index < len(q):
    c0, i = q[index]
    c = c0 + 1
    for l in vert[i]:
        if aoki_dist[l] >= 0:
            continue
        aoki_dist[i] = c
        q.append((c, l))
    index += 1

q = [(0, taka)]
max_dist = aoki_dist[taka]

index = 0
while index < len(q):
    c0, i = q[index]
    c = c0 + 1
    for l in vert[i]:
        if aoki_dist[l] < 0:
            continue
        if c >= aoki_dist[l]:
            continue
        if max_dist < aoki_dist[l]:
            max_dist = aoki_dist[l]
        aoki_dist[l] = -1
        q.append((c, l))
    index += 1

print(max_dist - 1)
Problem p02881 (python)

Fixed submission:
import math
N = int(input())

def eval_ab(a, b):
    if a == 1 or b == 1:
        return a + b - 1
    else:
        return a + b - 2
    
min_e = N - 1
a = int(math.sqrt(N)) + 2
for i in range(1, a):

    if N % i == 0:
        j = N // i
        e = eval_ab(i, j)
        min_e = min(e, min_e)

print(min_e)

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

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    a.sort()
    return a

def eval_ab(a, b):
    if a == 1 or b == 1:
        return a + b - 1
    else:
        return a + b - 2
    
def split(ary, a, b, i):
    e = eval_ab(a, b)

    if len(ary) == i:
        return eval_ab(a, b)
    v = ary[i]

    v1 = split(ary, a * v, b, i+1)
    v2 = split(ary, a, b * v, i+1)
    return min(v1, v2)

def light(ary):
    a = 1
    b = 1
    for v in ary:
        if a < b:
            a *= v
        else:
            b *= v
    return eval_ab(a, b)

ary = prime_factorize(N)
print(ary)

if len(ary) == 1:
    print(str(ary[0] - 1))
elif len(ary) == 2:
    cost = ary[0] + ary[1] - 2
    print(str(cost))
else:
    if N < 100000:
        v1 = split(ary, 1, 1, 0)
        print(v1)
    else:
        v1 = light(ary, 1, 1, 0)
        print(v2)
    #v2 = light(ary)
    #v1 = split(ary, 1, 1, 0)
    #print(v1, v2)
    #print(str(v))
Problem p02915 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
print(N ＊＊ 3)
Problem p03208 (python)

Fixed submission:
def main():
    N, K = [int(v) for v in input().split()]
    H = sorted([-int(input()) for _ in range(N)])

    min_diff = 10 ** 10
    for i in range(K - 1, N):
        min_diff = min(min_diff, -H[i - K + 1] + H[i])
    print(min_diff)

main()

Buggy submission (verdict: Runtime Error):
def main():
	N, K = [int(v) for v in input().split()]
    
    H = sorted([-int(input() for _ in range(N)])
    
    print(-H[0] + H[K - 1])
    
main()
Problem p02831 (python)

Fixed submission:
A,B=map(int,input().split())
import fractions
print(int((A*B)/fractions.gcd(A,B)))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
import fraction
print(int((A*B)/fraction.gcd(A,B)))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
import math
print(int((A*B)/math.gcd(A,B)))
Problem p02577 (python)

Fixed submission:
N=int(input())
if N%9==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = input()
for i in range(10):
  cnt += i * N.count(str(i))
print("Yes" if cnt % 9 == 0 else "No")
Problem p03286 (python)

Fixed submission:
N = int(input())
a = []
if N == 0:
    a = ["0"]
while N != 0:
    a.append(str(N % 2)) # N mod 2
    N = -(N - N % 2) // 2 # (N − (N mod 2)) // 2
print("".join(list(reversed(a))))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = []
if N == 0:
  a.append["0"]
while N != 0:
  a.append(str(N % 2))
  N = -(N // 2)
print("".join(reversed(a)))
Problem p02580 (python)

Fixed submission:
h,w,m=map(int, input().split())
a=[0]*m
hc=[0]*w
wc=[0]*h
for i in range(m):
	x,y=map(int, input().split())
	a[i]=[x-1,y-1]
	hc[y-1]+=1
	wc[x-1]+=1
hcm=max(hc)
wcm=max(wc)
hk=[0]*w
wk=[0]*h
for i in range(len(hc)):
	if hc[i]==hcm:
		hk[i]=1
for i in range(len(wc)):
	if wc[i]==wcm:
		wk[i]=1
c=0
for i in range(len(a)):
	if wk[a[i][0]]==1 and hk[a[i][1]]==1:
		c+=1
if c==sum(hk)*sum(wk):
	print(hcm+wcm-1)		
else:
	print(hcm+wcm)

Buggy submission (verdict: Runtime Error):
h,w,m=map(int, input().split())
a=[0]*m
hc=[0]*w
wc=[0]*h
for i in range(m):
	x,y=map(int, input().split())
	a[i]=[x-1,y-1]
	hc[y-1]+=1
	wc[x-1]+=1
hcm=max(hc)
wcm=max(wc)
hk=[0]*h
wk=[0]*w
for i in range(len(hc)):
	if hc[i]==hcm:
		hk[i]=1
for i in range(len(wc)):
	if wc[i]==wcm:
		wk[i]=1
c=0
for i in range(len(a)):
	if a[i][0]==wk[i] and a[i][1]==hk[i]:
		c+=1
if c==len(hk)*len(wk):
	print(hcm+wcm-1)		
else:
	print(hcm+wcm)

Buggy submission (verdict: Runtime Error):
h,w,m=map(int, input().split())
a = [[0 for j in range(w)] for i in range(h)]
for i in range(m):
	x,y=map(int, input().split())
	a[x-1][y-1]+=1
hc=[0 for i in range(w)]
wc=[0 for i in range(h)]
for i in range(w):
	for j in range(h):
		hc[i] += a[j][i]
for i in range(h):
	for j in range(w):
		wc[i] += a[i][j]
ans=0
for i in range(len(hc)):
	for j in range(len(wc)):
		if a[i][j]==1:
			if ans<hc[i]+wc[j]-1:
				ans=hc[i]+wc[j]-1
		else:
			if ans<hc[i]+wc[j]:
				ans=hc[i]+wc[i]
print(ans)

Buggy submission (verdict: Runtime Error):
h,w,m=map(int, input().split())
a = [[0 for j in range(w)] for i in range(h)]
for i in range(m):
	x,y=map(int, input().split())
	a[x-1][y-1]+=1
hc=[0 for i in range(w)]
wc=[0 for i in range(h)]
for i in range(w):
	for j in range(h):
		hc[i] += a[j][i]
for i in range(h):
	for j in range(w):
		wc[i] += a[i][j]
ans=0
for i in range(len(hc)):
	for j in range(len(wc)):
		if a[i][j]==1:
			if ans<hc[i]+wc[j]-1:
				ans=hc[i]+wc[j]-1
		else:
			if ans<hc[i]+wc[j]:
				ans=hc[i]+wc[i]
print(ans)
Problem p02859 (python)

Fixed submission:
n = int(input())
print(n*n)

Buggy submission (verdict: Runtime Error):
n = input()
print(n*n)
Problem p02860 (python)

Fixed submission:
m = input()
s = input()
n = len(s)
f = int(n/2)
if n%2 == 1:
	print("No")
else:
	if s[:f] == s[f:]:
		print("Yes")
	else:
		print("No")

Buggy submission (verdict: Runtime Error):
m = input()
s = input()
n = len(s)
if n%2 == 1:
	print("No")
else:
	if s[:n/2] == s[n/2:]:
		print("Yes")
	else:
		print("No")

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s)
if n%2 == 1:
	print("No")
else:
	if s[:n/2] == s[n/2:]:
		print("Yes")
	else:
		print("No")

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s)
if n%2 == 1
	print("No")
else
	if s[:n/2] == s[n/2:]
		print("Yes")
	else
		print("No")
Problem p02990 (python)

Fixed submission:
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, k= map(int, input().split())
for i in range(1,k+1):
	if n-k+1>=i:
		t = combinations_count(n-k+1, i) *  combinations_count(k-1, k-i)
		s = t%1000000007
		print(s)
	else:
		print(0)

Buggy submission (verdict: Runtime Error):
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, k= map(int, input().split())
for i in range(1,k+1):
	t = combinations_count(n-k+1, i) *  combinations_count(k-1, k-i)
	s = t%1000000007
	print(s)
Problem p02549 (python)

Fixed submission:
n, K = [int(a) for a in input().split()]
s = [[int(a) for a in input().split()] for _ in range(K)]

MOD = 998244353

dp = [0] * (n + 1)
dp_sum = [0] * (n + 1)
dp[1] = 1

for i in range(1, n+1):
    for l, r in s:
        dp[i] += dp_sum[i-l if (i-l) > 0 else 0] - dp_sum[(i-r-1) if (i-r-1) > 0 else 0]
        dp_sum[i] = (dp[i] + dp_sum[i-1]) % MOD

print(dp[n] % MOD)

Buggy submission (verdict: Runtime Error):
n, K = [int(a) for a in input().split()]
s = [[int(a) for a in input().split()] for _ in range(K)]

MOD = 998244353

dp = [0] * (n + 1)
dp_sum = [0] * (n + 1)
dp[1] = 1

for i in range(1, n+1):
    for l, r in s:
         dp[i] += dp_sum[i-l if (i-l) > 0 else 0] - dp_sum[(i-r-1) if (i-r-1) > 0 else 0]
        dp_sum[i] = (dp[i] + dp_sum[i-1]) % MOD

print(dp[n] % MOD)
Problem p02623 (python)

Fixed submission:
#!/usr/bin/env python3
N, M, K = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
B = [int(s) for s in input().split()]
i = 0
j = M-1

B_SUM = [0] * M
A_SUM = [0] * N
B_SUM[0] = B[0]
A_SUM[0] = A[0]
max_book = 0

if B_SUM[0] <= K:
    max_book = 1

for i in range(1, M):
    B_SUM[i] = B[i] + B_SUM[i - 1]
    if B_SUM[i] <= K:
        max_book = i + 1

A_SUM = 0
b_index = M - 1

for i in range(N):
    A_SUM += A[i]
    while (b_index >= 0):
        B_SUM[b_index]
        if A_SUM + B_SUM[b_index] <= K:
            max_book = max(max_book, b_index + 1 + i + 1)
            break
        b_index -= 1
    if (A_SUM <= K):
        max_book = max(max_book, i + 1)
print(max_book)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
N, M, K = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
B = [int(s) for s in input().split()]
i = 0
j = M-1

B_SUM = [0] * M
B_SUM[0] = B[0]

max_book = 0

for i in range(1, M):
    B_SUM[i] = B[i] + B_SUM[i - 1]
    if B_SUM[i] <= K:
        max_book = i + 1

A_SUM = 0

b_index = M - 1

for i in range(N):
    A_SUM += A[i]
    while (b_index >= 0):
        B_SUM[b_index]
        if A_SUM + B_SUM <= K:
            break
        b_index -= 1
    max_book = max(max_book, b_index + 1 + i + 1)

print(max_book)
Problem p02819 (python)

Fixed submission:
import math

def is_prime(x):
  if x <= 1:
    return False
  max_judge = math.sqrt(x)
  count = 2
  while(count < max_judge):
    if x % count == 0:
      return False
    count+=1
  return True
 
x = int(input())
 
judge_prime = False

while(True):
  if is_prime(x):
    break
  x+=1

print(x)

Buggy submission (verdict: Runtime Error):
def is_prime(x):
  if x <= 1:
    return False
  max_judge = sqrt(x)
  count = 2
  while(count < max_judge):
    if x % count == 0:
      return True
  return False

x = int(input())

judge_prime = False
while(!judge_prime):
  judge_prime = is_prime(x)
  
return x
Problem p02829 (python)

Fixed submission:
num = sum([int(input()) for s in range(2)])

if num == 5:
  print(1)
elif num == 4:
  print(2)
else:
  print(3)

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = [int(s) for s in input().split()]
 
min_breaks = -1
 
count_num = 1
break_index = 1

for i in range(N):
  if nums[i] == count_num:
      if min_breaks == -1:
          min_breaks = 0
      if count_num == 1:
      	 min_breaks += ((i+1) - break_index)
      else:
         min_breaks += ((i+1) - break_index - 1)
      
      break_index = (i+1)
      count_num+=1

if break_index < N and min_breaks != -1:
  min_breaks += ((i+1) - break_index)
  
print(min_breaks)
Problem p02831 (python)

Fixed submission:
A,B = [int(s) for s in input().split()]

C = 1
delta = 0.00000001
while( C < B ):
  if C*A % B < delta:
    break
  C+=1
  
print(C*A)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = 1
delta = 0.00000001
while( C < B ):
  if C*A % B < delta:
    break
  C+=1
  
print(C*A)

Buggy submission (verdict: Runtime Error):
C = 1
delta = 0.00000001
while( C >= B ):
  if C*A % B < delta:
    break
  C+=1
  
print(C*A)
Problem p02832 (python)

Fixed submission:
N = int(input())
nums = [int(s) for s in input().split()]
 
min_breaks = -1
 
count_num = 1
break_index = 1

for i in range(N):
  if nums[i] == count_num:
      if min_breaks == -1:
          min_breaks = 0
      if count_num == 1:
      	 min_breaks += ((i+1) - break_index)
      else:
         min_breaks += ((i+1) - break_index - 1)
      
      break_index = (i+1)
      count_num+=1

if break_index < N and min_breaks != -1:
  min_breaks += ((i+1) - break_index)
  
print(min_breaks)

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = [int(s) for s in input().split()]

min_breaks = -1

count_num = 1
for i in range(N):
  check_num = count - nums[i]
  if nums[i] == count_num:
      if min_breaks == -1:
          min_breaks = 0
      min_break += i - count_num
      
if min_break < N:    
    print(min_break)
else:
    print(-1)
Problem p02836 (python)

Fixed submission:
str_original = input()
N = len(str_original)
loop = int(N/2)
 
count = 0
for i in range(loop):
  if str_original[i] != str_original[(N-1)-i]:
     count+= 1
      
print(count)

Buggy submission (verdict: Runtime Error):
str_original = input()
N = len(str_original)
loop = floor(N/2)

count = 0
for i in range(loop):
  if str_original[i] != str_original[N-i]:
     count+= 1
      
return count
Problem p02860 (python)

Fixed submission:
N = input()
S = input()
index = len(S) // 2

if len(S) % 2 != 0:
  print('No')
elif S[:index] != S[index:]:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
str_input = input()
 
if N % 2 != 0:
  print('No')
else:
  print('Yes') if str_input[:N/2] == str_input[(N/2):] else print('No')

Buggy submission (verdict: Runtime Error):
import sys

N = int(input())
str_input = input()

if N % 2 != 0:
  print('No')
else:
  print('Yes') if str_input[:N/2] == str_input[:N] else print('No')

Buggy submission (verdict: Runtime Error):
S = input()

if len(S) % 2 != 0:
  matched = False
else:
  matched = True
  index = len(S)//2
  for i in range(index+1):
  	if S[i] != S[index+1]
    	matched = False
        break
        
if mathed:
  print('Yes')
else:
  print('False')
Problem p02879 (python)

Fixed submission:
def LI():
  return [int(s) for s in input().split()]

A,B = LI()

print(A*B) if A < 10 and B < 10 else print(-1)

Buggy submission (verdict: Runtime Error):
def LI():
  return [int(s) for s in input.split()]

A,B = LI()

print(A*B) if A < 10 and B < 10 else print(-1)

Buggy submission (verdict: Runtime Error):
def LI():
  return [int(s) for s in input.split()]

A,B = LI()

print(A*B)

Buggy submission (verdict: Runtime Error):
def LI():
  return [int(s) for s in input.split()]

A,B = LI()

print(A*B)
Problem p02881 (python)

Fixed submission:
import math
 
N = int(input())
 
min_cand = 10**12
 
for i in range(1,(int(math.sqrt(N))+1)):
  if N % i == 0 and min_cand > (i + (N // i)):
    min_cand = (i + (N // i))
    
print(min_cand - 2)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())

min_cand = 10**9

for i in range(1,(int(math.sqrt(N))+1):
  if N % i == 0 and min_cand < (i + (N // i)):
    min_cond = (i + (N // i))
    
print(min_cond - 2)
Problem p02912 (python)

Fixed submission:
import heapq
import math
 
def LI():
  return [int(s) for s in input().split()]
 
N,M = LI()
a = LI()
a = list(map(lambda x: x*(-1), a))  # 各要素を-1倍
 
heapq.heapify(a)
 
for i in range(M):
    x = (-1)*(abs(heapq.heappop(a))//2)
    heapq.heappush(a,x)

cost = 0
for i in range(N):
  x = heapq.heappop(a)
  cost+=abs(x)
  
print(cost)

Buggy submission (verdict: Runtime Error):
import heapq

K = input()
a = LI()

a = list(map(lambda x: x*(-1), a))  # 各要素を-1倍

heapq.heapify(a)

for i in range(
print(heapq.heappop(a)*(-1))  # 最大値の取り出し
print(a)
Problem p02729 (python)

Fixed submission:
#スペース区切りの整数入力
N, M  = map(int, input().split())


if N >= 2:
    N_even = N*(N - 1)/2
else:
    N_even = 0

if M >= 2:
    M_even = M*(M-1)/2
else:
    M_even = 0

print(int(N_even + M_even))

Buggy submission (verdict: Runtime Error):
#スペース区切りの整数入力
N, M  = map(int, input().split())

if N > 2:
    N_even = N*(N - 1)/2
else:
    N_even = 0

if M > 2:
    M_even = M*(M-1)/2
else:
    M_even = 0

print(int(N_even + M_even))
Problem p02753 (python)

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

Buggy submission (verdict: Runtime Error):
s = str(input())

if s == "AAA" or S == "BBB":
  print('No')
else:
  print('Yes')
Problem p02754 (python)

Fixed submission:
N, A, B = map(int,input().split())
 
x = A * (N // (A+B))
 
y = N % (A+B)
 
ans = x + min(A, y)
 
print(ans)

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

X = N*(A*'b' + B*'r')
print(X)

cnt = X.count('b', 0, N)
print(cnt)

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

b = '1'
r = '0'

x =[]
cnt = 0
while len(x) < N:
  x.append(A*b)
  x.append(B*r)

for i in range(x):
  tmp = 0
  tmp = int(i)
  cnt += i

pint(cnt)