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

Fixed submission:
N,M=(int(x) for x in input().split())

k = N + M

if N >= 0 and M <=100 and N+M >=2: 
    int((N + M) * (N + M - 1) / 2 - (N * M))
    print(int(k * (k - 1) / 2 - (N * M)))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-2 1
import math
    
N,M=(int(x) for x in input().split())

k = N + M

if N >= 0 and M <=100 and N+M >=2:
    print(int(((math.factorial(k))/2- N * M)))

Buggy submission (verdict: Runtime Error):
import math
    
N,M=(int(x) for x in input().split())

k = N + M

if N >= 0 and M <=100 and N+M >=2:
    print(int(((math.factorial(k))/2- N * M)))
Problem p02699 (python)

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

if(s <= w):
    print("unsafe")
else:
    print("safe")

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

while(A or C != 0):
    C = C - B
    if(C <= 0):
        print("Yes")
        break
    A = A - D
    if(A <= 0):
        print("No")
        break
Problem p02676 (python)

Fixed submission:
#import numpy as np
#a,b,c=map(int,input().split())
z=int(input())
a=input()
if len(a)>z:
    b=a[:z]
    print(b+"...")
else:
    print(a)

Buggy submission (verdict: Runtime Error):
#import numpy as np
#a,b,c=map(int,input().split())
z=int(input())
a=input()
if len(a)>z:
    b=a[:z]
    print(b+"...")
else:
    print(b)
Problem p02711 (python)

Fixed submission:
a=str(input())
if "7"in a:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

a=int(input())
b=str(input())
sum=0
c=b
d=b
i=0
for s in b:
    for n in range(i,a):
        if c[n]!=c[i]:
            j=n-i
            if a>=n:
                for m in range(n,a):
                    if c[m]!=c[i] and c[m]!=c[n]:
                        k=m-n
                        if k!=j:
                            sum+=1



    i+=1
print(sum)

Buggy submission (verdict: Runtime Error):
import re
a=int(input())
b=str(input())
sum=0
c=b
d=b
i=0
for s in b:
    for n in range(i,a):
        if c[n]!=c[i]:
            j=n-i
            if a>=n:
                for m in range(n,a):
                    if c[m]!=c[i] and c[m]!=c[n]:
                        k=m-n
                        if k!=j:
                            sum+=1



    i+=1
print(sum)
Problem p02829 (python)

Fixed submission:
def main():
  A = int(input())
  B = int(input())
  C = 6-A-B
  print('{}'.format(C))


if __name__ == '__main__':
  main()

Buggy submission (verdict: Runtime Error):
def main():
  a=int(input())
  b=int(input())
  c=6-a-b
  print(c)
  
 if __name__ == ′__main__′:
  main()
Problem p02847 (python)

Fixed submission:
def main():
  S = input()
  day = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
  count = 7
  for i in day:
    if S == i:
        print(count)
    count -= 1

if __name__ == '__main__':
  main()

Buggy submission (verdict: Runtime Error):
def main():
  S = input()
  day = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
  count = 7
  for i in day:
    if S == i:
        print(count)
    i -= 1

if __name__ == '__main__':
  main()
Problem p02785 (python)

Fixed submission:
n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort()
if n <= k:
    print(0)
elif n > k:
    for i in range(k):
        h[n-i-1] = 0
    print(sum(h))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort()
for i in range(k):
    h[n-i-1] = 0
print(sum(h))
Problem p02831 (python)

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

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

Fixed submission:
N = int(input())
ans = []
for i in range(1,int(pow(N,0.5))+1):
    j = N//i
    if i*j == N:
        ans.append(i+j)

print(min(ans)-2)

Buggy submission (verdict: Runtime Error):
import sympy as sp
import heapq as hq
N = int(input())
A = sp.factorint(N)
B = []
hq.heapify(B)
for i,j in A.items():
    while j != 0:
        hq.heappush(B,i)
        j -= 1
leng = len(B)
if leng == 1:
    print(B[0]-1)
    exit()

while leng > 2:
    a = hq.heappop(B)
    b = hq.heappop(B)
    hq.heappush(B,a*b)
    leng -= 1
print(sum(B)-2)
Problem p03013 (python)

Fixed submission:
N,M = map(int,input().split())
A = [int(input()) for i in range(M)]
INF = 10**9+7
ans = [0]*(N+1)
ans[1] = 1
if M != 0:
    s = A[0]
    if s == 1:
        ans[1] = 0
A = set(A)
ans[0] = 1

for i in range(2,N+1):
    if i in A:
        ans[i] = 0
    else:
        ans[i] = ans[i-1] + ans[i-2]
        ans[i] %= INF
        
print(ans[-1])

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = [int(input()) for i in range(M)]
INF = 10**9+7
s = A[0]
A = set(A)

ans = [0]*(N+1)
ans[0] = 1
if s == 1:
    ans[1] = 0
else:
    ans[1] = 1


for i in range(2,N+1):
    if i in A:
        ans[i] = 0
    else:
        ans[i] = ans[i-1] + ans[i-2]
        ans[i] %= INF
        
print(ans[-1])
Problem p02790 (python)

Fixed submission:
# ABC152
a,b = map(int, input().split())
 
if a<b:
    ans=str(a)*b
else:
    ans=str(b)*a
print(ans)

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

if a<b:
    ans=f"{a}"*b
else:
    ans=f"{b}"*a
print(ans)
Problem p02679 (python)

Fixed submission:
import math
import bisect
MOD = 1000000007

N = int(input())
ABs =  []

count00 = 0
for i in range(N):
  A, B = map(int, input().split())
  if A == 0:
    if B == 0:
      count00 += 1
    else:
      ABs.append([0, -1])
  elif B == 0:
    ABs.append([1, 0])
  else:
    mygcd = math.gcd(A, B)
    A, B = A//mygcd, B//mygcd
    if A < 0:
      ABs.append([-A, -B])
    else:
      ABs.append([A, B])
  
N2 = N - count00
if N2 == 0:
  print(count00)
  exit()

ABs.sort(key = lambda x:x[1])
Bs = [i[1] for i in ABs]
index0 = bisect.bisect_left(Bs, 0)

if (index0==0) or (index0==N2):
  print((pow(2, N2, MOD) +count00 -1) %MOD)
  exit()

btm = ABs[:index0]
top = ABs[index0:]

lenbtm = index0
lentop = N2 - index0
for i in range(lenbtm):
  btm[i] = [-btm[i][1], btm[i][0]]

btmdict = {}
topdict = {}
for i in btm:
  mykey = str(i[0]) + '-' + str(i[1])
  btmdict[mykey] = 0
  topdict[mykey] = 0
for j in top:
  mykey = str(j[0]) + '-' + str(j[1])
  btmdict[mykey] = 0
  topdict[mykey] = 0

for i in btm:
  mykey = str(i[0]) + '-' + str(i[1])
  btmdict[mykey] += 1
for j in top:
  mykey = str(j[0]) + '-' + str(j[1])
  topdict[mykey] += 1

ans = 1
for i in btmdict:
  btmi = btmdict[i]
  topi = topdict[i]
  if btmi*topi >= 1:
    ans = ans * (pow(2, btmi, MOD) +pow(2, topi, MOD) -1) %MOD
  elif btmi == 0:
    ans = ans * pow(2, topi, MOD) %MOD
  else:
    ans = ans * pow(2, btmi, MOD) %MOD

ans = (ans +count00 -1) %MOD
print(ans)

Buggy submission (verdict: Runtime Error):
import math
import bisect
N = int(input())
atans =  [0 for _ in range(N)]
for i in range(N):
  A, B = map(int, input().split())
  if A == 0:
    atans[i] = 90
  else:
    atans[i] = math.degrees(math.atan(A/B))

atans.sort()
index0 = bisect.bisect_left(atans, 0)
if (index0==0) or (index0==N):
  print(pow(2, N, 1000000007) -1)
  exit()

left = atans[:index0]
right = atans[index0:]
ans = 1

lenleft = index0
lenright = N - index0
now = -90
for i in range(index0):
  if left[i]==now:
    continue
  now = left[i]
  target = now+90
  same1 = bisect.bisect_right(right, target) - bisect.bisect_left(right, target)
  
  if same1 >= 1:
    lenright -= same1
    same2 = bisect.bisect_right(left, now) - bisect.bisect_left(left, now)
    ans = ans * (pow(2,same1,1000000007)+pow(2,same2,1000000007)-1) %1000000007
  else:
    ans = ans * 2 %1000000007

ans = (ans * pow(2, lenright, 1000000007) -1) % 1000000007
print(ans)
Problem p03011 (python)

Fixed submission:
p = list(map(int, input().split()))
print(sum(p)-max(p))

Buggy submission (verdict: Runtime Error):
p = list(map(int, input()))
print(sum(p)-max(p))
Problem p03327 (python)

Fixed submission:
n=int(input())
if n<=999:
  print('ABC')
else:
  print('ABD')

Buggy submission (verdict: Runtime Error):
n=int(input())
if n<=999:
  print('ABC'+'{0:03d}'.format(n))
else:
  n=n-999
  print('ABD'+{0:03d}'.format(n))
Problem p03774 (python)

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

idou = []
for a, b in student:
  idousaki = -1
  nearest = 1000000000
  for i, xy in enumerate(cp):
    d = abs(xy[0]-a) + abs(xy[1]-b)
    if d < nearest:
      nearest = d
      idousaki = i+1
      
  idou.append(idousaki)
  
for i in idou:
  print(i)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
student = [list(map(int, input().split())) for _ in range(N)]
cp = [list(map(int, input().split())) for _ in range(M)]

idou = []
for a, b in student:
  idousaki = -1
  nearest = 1000000000
  for i, x, y in enumerate(cp):
    d = abs(x-a) + abs(y-b)
    if d < nearest:
      nearest = d
      idousaki = i+1
      
  idou.append(idousaki)
  
for i in idou:
  print(i)
Problem p03804 (python)

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

for i in range(N-M+1):
  for j in range(N-M+1):
    
    for k in range(M):
      if A[i+k][j:j+M] != B[k]:
        break
    else:
      print('Yes')
      exit()

print('No')

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

for i in range(N-M+1):
  for j in range(N-M+1):
    
    for k in range(M):
      if A[i+k][j:j+M] != B[k]:
        break
    else:
      print('Yes')
      exit()
      
    break

print('No')
Problem p03834 (python)

Fixed submission:
print(input().replace(',', ' '))

Buggy submission (verdict: Runtime Error):
print(' '.join(input().split(','))
Problem p02688 (python)

Fixed submission:
n, k = map(int, input().split())
li = []
for x in range(k*2):
    li.append(input().split())
li2 = []
i = 1
while i < k*2:
    for j in li[i]:
        li2.append(j)
    i += 2
li2 = set(li2)
print(n - len(li2))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
lis = []
for i in range(k*2):
    lis.append(input().split())
lis2 = []
j = 1
while j < k*2:
    for k in lis[j]:
        lis2.append(k)
    j += 2
lis2 = set(lis2)
print(n - len(lis2))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
li = []
for x in range(k2):
    li.append(input().split())
li2 = []
i = 1
while i < k2:
    for j in li[i]:
        li2.append(j)
    i += 2
li2 = set(li2)
print(n - len(li2))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
lis = []
for i in range(k*2):
    lis.append(input().split())
lis2 = []
j = 1
while j < k2:
    for k in lis[j]:
        lis2.append(k)
    j += 2
lis2 = set(lis2)
print(n - len(lis2))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
lis = []
for i in range(k*2):
    lis.append(input().split())
lis2 = []
j = 1
while j < k*2:
    for k in lis[j]:
        li2.append(k)
    j += 2
lis2 = set(lis2)
print(n - len(lis2))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
lis = []
for i in range(ki):
    lis.append(input().split())
lis2 = []
j = 1
while j < ki:
    for j in li[i]:
        li2.append(j)
    j += 2
lis2 = set(lis2)
print(n - len(lis2))
Problem p02707 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
sub = []
for i in range(0, n):
    sub.append(0)
for j in a :
    sub[j - 1] += 1
for i in sub:
    print(i)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
l = []
for i in range(n):
    l.append(0)
for j in a:
    l[j-1] += 1
for k in l:
    print(s)
Problem p02711 (python)

Fixed submission:
n = str(input())
x = 0
for num in n:
    if int(num) == 7 :
        x += 1
if x == 0 :
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
if '7' in list(n):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
if '7' in list(n):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
if '7' in list(n):
    print("Yes")
else:
    print("No")
Problem p02659 (python)

Fixed submission:
a = input().split()
s1 = a[0]
s2 = a[1]
num1 = int(s1)
num2 = int(s2[0])*100 + int(s2[2]+s2[3])

print((num1*num2)//100)

Buggy submission (verdict: Runtime Error):
import math

a = input().split()
s1 = a[0]
s2 = a[1]
num1 = int(s1)
num2 = int(s[0])*100 + int(s[2]+s[3])

print((num1*num2)//100)

Buggy submission (verdict: Runtime Error):
import math

a,b = map(input().split())
a = int(a)
b = int(b[0])*100+int(b[2]+b[3])
print((a*b)//100)
Problem p02701 (python)

Fixed submission:
N = int(input())
s = set()

for i in range(N):
    s.add(input())
    
print (len(s))

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <set>
#include <string>
using namespace std;
int main(void){
    int N;
    cin >> N;
    std::set<std::string> s;
    
    for(int i=0; i < N; i++){
        std::string a;
        cin >> a;
        s.insert(a);
    }
    
    cout << s.size() << endl;
}
Problem p02831 (python)

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

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
A, B = map(int , input().split())
print(lcm(A, B))
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())

if a == 1:
  if b == 2:
    print(3)
  else:
    print(2)

if a == 2:
  if b == 1:
    print(3)
  else:
    print(1)

if a == 3:
  if b == 1:
    print(2)
  else:
    print(1)

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

if a == 1:
  if b == 2:
    print(3)
  else:
    print(2)

if a == 2:
  if b == 1:
    print(3)
  else:
    print(1)

if a == 3:
  if b == 1:
    print(2)
  else:
    printj(1)
Problem p02835 (python)

Fixed submission:
A = input()
A = list(A.split())
sum = 0

for i in A:
  sum += int(i)

if sum >= 22:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
a1 = input('a1:')
a2 = input('a2:')
a3 = input('a3:')


sum = int(a1) + int(a2) + int(a3)

if sum >= 22:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
a1 = input('a1:')
a2 = input('a2:')
a3 = input('a3:')


sum = int(a1) + int(a2) + int(a3)

if sum >= 22:
  print('bust')
else:
  print('win')
Problem p02912 (python)

Fixed submission:
from heapq import heappop, heappush, heapify
n, m = map(int, input().split())
a = list(map(int, input().split()))
q = []
for x in a:
	heappush(q, -x)
for _ in range(m):
	l = heappop(q)
	heappush(q, -((-l)//2))
print(-sum(q))

Buggy submission (verdict: Runtime Error):
import heapq
n ,m = map(int,input().split())
arr =list(map(int,input().split()))
for _ in range(m):
  j = heapq.nlargest(1,arr)//2
  arr.remove(max(arr))
  arr.append(j)
print(sum(arr))
Problem p02933 (python)

Fixed submission:
a = int(input())
color = input()
 
if a < 3200:
  print("red")
else:
  print(color)

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

if a < 3200:
  print("red")
  else
  print(color)

Buggy submission (verdict: Runtime Error):
a = input()
color = input()

if a < 3200:
  print("red")
  else
  print(color)
Problem p02935 (python)

Fixed submission:
a = int(input())
b = sorted(list(map(int,input().split())))
for i in range(a):
  if i == 0 :
    c = b[0]
  else:
    c = (b[i]+c)/2
print(c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = sorted(list(map(int,input().split())))
for i in range(a):
  if a == 0 :
    c = b[0]
  else:
    c = (b[i]+c)/2
print(c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = sorted(list(map(int,input().split())))
for i in range(a):
  if a = 0 :
    c = b[0]
  else:
    c = (b[i]+c)/2
print(c)
Problem p02659 (python)

Fixed submission:
import math
from decimal import Decimal
a,b, = map(Decimal,input().split());
c = a*b
print(math.floor(c));

Buggy submission (verdict: Runtime Error):
a,b, = map(int,input().split());
c = a*b
print(int(c));
Problem p03208 (python)

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

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

tree.sort()

print(min(tree[i+K-1] - tree[i] for i in range(N-K+1)))

Buggy submission (verdict: Runtime Error):
import scipy as sp

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

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

tree.sort()

print(min(tree[N-K+i] - tree[i] for i in range(N-K+1)))
Problem p02695 (python)

Fixed submission:
#import numpy as np
import math
#from fractions import gcd

def check_Q(current_list,Qset):

    sum_d = 0
    for i in range(len(Qset)):
        current_Qset = Qset[i]
        #print(current_Qset)
        #print(current_list)
        #print(sum_d)
        if (current_list[current_Qset[1]-1]-current_list[current_Qset[0]-1])==current_Qset[2]:
            sum_d = sum_d+current_Qset[3]

    return sum_d

def check_N(preget_list,zan_pre,M,nokori_N,Qset):

    if nokori_N==1:
        sum_list = []
        for i in range(zan_pre,M+1):
            current_list = preget_list+[i]
            sum_list.append(check_Q(current_list,Qset))

        return sum_list
    else:
        sum_list = []
        for i in range(zan_pre,M+1):
            current_list = preget_list+[i]
            sum_list = sum_list + check_N(current_list,i,M,nokori_N-1,Qset)

        return sum_list

def main():

    ##get int
    first_input = list(map(lambda x:int(x), input().split(" ")))
    #second_input = list(map(lambda x:int(x), input().split(" ")))

    ##get float
    #first_input = list(map(lambda x:float(x), input().split(" ")))
    #second_input = list(map(lambda x:float(x), input().split(" ")))

    ##get string
    #first_input = input().split(" ")

    N = first_input[0]
    M = first_input[1]
    Q = first_input[2]

    Qset = []
    for i in range(Q):
        secondkara_input = list(map(lambda x:int(x), input().split(" ")))
        Qset.append(secondkara_input)

    #print(check_N([],1,M,N,Qset))
    print(max(check_N([],1,M,N,Qset)))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#import numpy as np
import math
#from fractions import gcd

def check_Q(current_list,Qset):

    sum_d = 0
    for i in range(len(Qset)):
        current_Qset = Qset[i]
        if (current_list[current_Qset[1]-1]-current_list[current_Qset[0]-1])==current_Qset[2]:
            sum_d = sum_d+current_Qset[3]

    return sum_d

def check_N(preget_list,zan_pre,M,nokori_N,Qset):

    if nokori_N==1:
        sum_list = []
        for i in range(zan_pre,M+1):
            current_list = preget_list+[i]
            sum_list.append(check_Q(current_list,Qset))

        return sum_list
    else:
        sum_list = []
        for i in range(zan_pre,M+1):
            current_list = preget_list+[i]
            sum_list = sum_list + check_N(current_list,i+1,M,nokori_N-1,Qset)

        return sum_list

def main():

    ##get int
    first_input = list(map(lambda x:int(x), input().split(" ")))
    #second_input = list(map(lambda x:int(x), input().split(" ")))

    ##get float
    #first_input = list(map(lambda x:float(x), input().split(" ")))
    #second_input = list(map(lambda x:float(x), input().split(" ")))

    ##get string
    #first_input = input().split(" ")

    N = first_input[0]
    M = first_input[1]
    Q = first_input[2]

    Qset = []
    for i in range(Q):
        secondkara_input = list(map(lambda x:int(x), input().split(" ")))
        Qset.append(secondkara_input)

    #print(check_N([],1,M,N,Qset))
    print(max(check_N([],1,M,N,Qset)))

if __name__ == '__main__':
    main()
Problem p02847 (python)

Fixed submission:
s = input()
if s == 'SUN':
	print('7')
elif s == 'MON':
	print('6')
elif s == 'TUE':
	print('5')
elif s == 'WED':
	print('4')
elif s == 'THU':
	print('3')
elif s == 'FRI':
	print('2')
elif s == 'SAT':
	print('1')

Buggy submission (verdict: Runtime Error):
s = input()
if s = 'SUN':
	print('7')
elif s = 'MON':
	print('6')
elif s = 'TUE':
	print('5')
elif s = 'WED':
	print('4')
elif s = 'TUE':
	print('3')
elif s = 'FRI':
	print('2')
elif s = 'SAT':
	print('1')
Problem p02860 (python)

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

if n % 2 != 0:
    print('No')
else:
    t = s[0:int(n / 2)]
    if t * 2 == s:
        print('Yes')
    else:
        print('No')

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

if n % 2 != 0:
    print('No')
else:
    t = s[0:int(n / 2)]
    if t * 2 == s:
        print('Yes')
    else:
        print('No')
 =
Problem p02879 (python)

Fixed submission:
a, b = map(int, input().split())
if a <= 9 and b <= 9:
	c = a * b
	print(c)
else:
	print('-1')

Buggy submission (verdict: Runtime Error):
a, b = int(input().split())
if a <= 9 and b <= 9:
	c = a * b
	print(c)
else:
	print('-1')

Buggy submission (verdict: Runtime Error):
a,b = int(input().split())
if a <= 9 and b <= 9:
	c = a * b
	print(c)
else:
	print('-1')

Buggy submission (verdict: Runtime Error):
a,b = int(input().split())
if a <= 9 and b <= 9:
	print(a * b)
else:
	print('-1')

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

if 1 <= a <= 9 and 1 <= b <= 9:
	print(a * b)
else:
	print('-1')
Problem p02860 (python)

Fixed submission:
import sys
n=int(input())
s=input()
if n%2!=0:
  print("No")
  sys.exit()
for i in range(n//2):
  if s[i]!=s[n//2+i]:
    print("No")
    sys.exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
s=input()
if n%2!=0:
  print("No")
  sys.exit()
for i in range(n//2):
  if s[i]!=s[n//2+1]:
    print("No")
    sys.exit()
print("Yes")
Problem p02862 (python)

Fixed submission:
import sys
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

x,y=map(int,input().split())
if (x+y)%3!=0:
  print(0)
  sys.exit()
n=(x+y)//3

mod = 10**9+7 #出力の制限
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, n + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

print(cmb(n,x-n,mod))

Buggy submission (verdict: Runtime Error):
import sys
import math
x,y=map(int,input().split())
if (x+y)%3!=0:
  print(0)
  sys.exit()
n=(x+y)//3
print(math.factorial(n)//math.factorial(x-n)//math.factorial(y-n))

Buggy submission (verdict: Runtime Error):
import sys
import math
x,y=map(int,input().split())
if (x+y)%3!=0:
  print(0)
  sys.exit()
n=(x+y)//3
print(math_factorial(n)//math_factorial(x-n)//math_factorial(y-n))

Buggy submission (verdict: Runtime Error):
import sys
x,y=map(int,input().split())
if (x+y)%3!=0:
  print(0)
  sys.exit()
n=(x+y)//3
fac=[1 for i in range(n+1)]#fac[i]=i!. fac[0]=1
for i in range(n+1):
  fac[i]=fac[i-1]*i

print(fac[n]//fac[x-n]//fac[y-n])

Buggy submission (verdict: Runtime Error):
inport sys
x,y=map(int,input().split())
if (x+y)%3!=0:
  print(0)
  sys.exit()
n=(x+y)//3
fac=[1 for i in range(n+1)]#fac[i]=i!. fac[0]=1
for i in range(n+1):
  fac[i]=fac[i-1]*i

print(fac[n]//fac[x-n]//fac[y-n])

Buggy submission (verdict: Runtime Error):
inport sys
fac=[1 for i in range(n+1)]#fac[i]=i!. fac[0]=1
for i in range(n+1):
  fac[i]=fac[i-1]*i

def comb(n,k):
  return fac[n]//fac[k]//fac[n-k]

x,y=map(int,input().split())
if (x+y)%3!=0:
  print(0)
  sys.exit()
n=(x+y)//3
print(comb(n,x-n))