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

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

CB = []
for i in BC:
    CB.append([i[1], i[0]])

A.sort()
CB.sort(reverse=True)

cnt = 0
for i in CB:
    for j in range(i[1]):
        if cnt < N:
            if A[cnt] < i[0]:
                A[cnt] = i[0]
                cnt += 1
            else:
                print(sum(A))
                exit()
        else:
            print(sum(A))
            exit()

print(sum(A))

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

CB = []
for i in BC:
    CB.append([i[1], i[0]])

A.sort()
CB.sort(reverse=True)

cnt = 0
for i in CB:
    for j in range(i[1]):
        if A[cnt] < i[0] and cnt < N:
            A[cnt] = i[0]
            cnt += 1
        else:
            print(sum(A))
            exit()

print(sum(A))
Problem p02627 (python)

Fixed submission:
tmp = input()

if tmp.isupper():
    print("A")
else:
    print("a")

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

if in.isupper():
  print("A")
else:
  print("a")
Problem p02860 (python)

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

if n % 2 == 1:
    print("No")
else:
    if s[:(n//2)] == s[(n//2):]:
        print("Yes")
    else:
        print("No")

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

if n % 2 == 1:
    print("No")
else:
    if s[:(n//2)] == x[(n//2):]:
        print("Yes")
    else:
        print("No")
Problem p02862 (python)

Fixed submission:

# Python3 function to  
# calculate nCr % p 
def ncr(n, r, p): 
    # initialize numerator 
    # and denominator 
    num = den = 1 
    for i in range(r): 
        num = (num * (n - i)) % p 
        den = (den * (i + 1)) % p 
    return (num * pow(den,  
            p - 2, p)) % p 


x, y = map(int,input().split())

if not((x + y) % 3 == 0):
    print(0)
elif (x > 2*y) or (y > 2 * x):
    print(0)
else:
    k = (x + y) // 3
    i = x - k
    print(ncr(k, i, 10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
def mod_combination(n, k, mod):
    # nCk (mod m)
    def mod_permutation(n, k, mod):
        if n<=k:
            return 1
        else:
            return (n * mod_permutation(n-1,k,mod))%mod

    def mod_inv_permutation(k, mod):
        k, mod = int(k), int(mod)
        if k<=1:
            return 1
        else:
            return (pow(k,mod-2,mod) * mod_inv_permutation(k-1, mod))%mod

    return (mod_permutation(n,n-k,mod) * mod_inv_permutation(k, mod))%mod

x, y = map(int,input().split())

if not((x + y) % 3 == 0):
    print(0)
elif (x > 2*y) or (y > 2 * x):
    print(0)
else:
    k = (x + y) // 3
    i = x - k
    print(mod_combination(k, i, 10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

x, y = map(int,input().split())

if not((x + y) % 3 == 0):
    print(0)
elif (x > 2*y) or (y > 2 * x):
    print(0)
else:
    k = (x + y) // 3
    i = x - k
    print(comb(k, i, exact=True) % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

x, y = map(int,input().split())

if not((x + y) % 3 == 0):
    print(0)
elif (x > 2*y) or (y > 2 * x):
    print(0)
else:
    k = (x + y) // 3
    i = x - k
    print(comb(k, i, exact=True))
Problem p02897 (python)

Fixed submission:
n = int(input())
if n % 2 == 0:
    odds = n // 2
else:
    odds = (n // 2)  + 1
ans = odds / n
print(ans)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
n = min(a, b)
def get_primenumber(N):
    #素数リスト
    prime_list = [2]
    #3からNまでの数字を一つずつ取り出す
    for num in range(3,N+1,2):
      #取り出した数字が素数リストの要素で割れなければ素数リストに追加する
      if all( num % prime != 0 for prime in prime_list):
        prime_list.append(num)

    return prime_list
l = get_primenumber(n)
count = 1
for p in l:
    if a % p == 0 and b % p == 0:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
n = min(a, b)
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]
l = primes(n)
count = 1
for p in l:
    if a % p == 0 and b % p == 0:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
odds = (n // 2)  + 1
ans = odds / n
return ans
Problem p02990 (python)

Fixed submission:
import math

n,k = map(int,input().split())

def combinations_count(a, b):
    return math.factorial(a)//(math.factorial(a-b)*math.factorial(b))


blue = k
#両端を除いた隙間の数
blue_sp = k-1
red = n-k
#両端を含む隙間の数
red_sp = red+1


#青をグループに分けて，赤の隙間に入れる組合せを考える
#1から
for i in range(1,blue+1):
    #print(blue_sp,i-1,":",red_sp,i)        

    #出力
    #青のグループ数が赤の隙間より多い場合
    if i > red_sp:
        print(0)
    else:       
        #青のグループ分けの組合せ(両端を除いた隙間，選択する数)
        b_num = combinations_count(blue_sp,i-1)
        #赤を並べて，そこに青のグループを置く組合せ
        a_num = combinations_count(red_sp,i)
        print((b_num*a_num)%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math

n,k = map(int,input().split())

def combinations_count(a, b):
    return math.factorial(a)//(math.factorial(a-b)*math.factorial(b))

if n==k:
    print(1)
    for i in range(2,k+1):
        print(0)
            
else:
    for i in range(1,k+1):
        #print(k-1,i-1)    
        #青のグループ分けの組合せ
        b_num = combinations_count(k-1,i-1)
        #赤を並べて，そこに青のグループを置く組合せ
        a_num = combinations_count(n-k+1,i)
        #出力
        print((b_num*a_num)%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math

n,k = map(int,input().split())

def combinations_count(a, b):
    return math.factorial(a)//(math.factorial(a-b)*math.factorial(b))

for i in range(1,k+1):
    #青のグループ分けの組合せ
    b_num = combinations_count(k-1,i-1)
    #赤を並べて，そこに青のぶるーぷを置く組合せ
    a_num = combinations_count(n-k+1,i)
    #出力
    print((b_num*a_num)%(10**9+7))
Problem p03127 (python)

Fixed submission:
import fractions as fr
import functools as ft


N = map(int, input().split())
A = list(map(int, input().split())) # "1 2 3"と入力

cal1 = lambda x, y : fr.gcd(x, y)

print(ft.reduce(cal1, A))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
#入力
N = map(int,input().strip().split(' '))         #モンスタ数
A = list(map(int, input().strip().split(' '))) #それぞれの体力


#最大公約数
print( reduce(lambda x, y: math.gcd(x,y), A) )

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
#入力
N = map(int,input().strip().split(' '))         #モンスタ数
A = list(map(int, input().strip().split(' '))) #それぞれの体力


#最大公約数
print( reduce(lambda x, y: math.gcd(x,y), A) )

#PASS (lambda A[i], A[i-1] :math.gcd(A[i],A[i-1]), A))
Problem p03317 (python)

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

ans = -(-(n-1)//(k-1))

print(ans)

Buggy submission (verdict: Runtime Error):
def function(n,k,a):
    ind1 = a.index(1)
    pre = len(a[:ind1])
    ex = len(a[ind1:])    
    ans = -(-pre//(k-1)) + -(-ex//(k-1))
    if n == k:
        ans = 1
    return int(ans)

print(function(n,k,a))
Problem p02622 (python)

Fixed submission:
#[s,t]=input().split();
s=input();
t=input();
cnt = 0;
for i in range(len(s)):
    if s[i] != t[i] :
        cnt=cnt+1;
        
print(cnt);

Buggy submission (verdict: Runtime Error):
[s,t]=input().split();
cnt = 0;
for i in range(len(s)):
    if s[i] != t[i] :
        cnt=cnt+1;
print(cnt);

Buggy submission (verdict: Runtime Error):
[s,t]=input().split();

cnt = 0;
for i in range(len(s)):
    if s[i] != t[i] :
        cnt=cnt+1;
        
print(cnt);
Problem p03617 (python)

Fixed submission:
price = [int(x) for x in input().split()];
N = int(input());
price_d = price[3];
price_s = 2*price[2];
price_h = 4*price[1];
price_q = 8*price[0];
p = min([price_q,price_h,price_s]);
if price_d < p :
    if N%2 == 1 :
        ans = (N-1)//2*price_d + p//2;
    else :
        ans = N//2*price_d;
else :
    ans = N*p//2;

print(ans);

Buggy submission (verdict: Runtime Error):
price = [int(x) for x in input().split()];
N = int(input());
price_d = price[3];
price_s = 2*price[2];
price_h = 4*price[1];
price_q = 8*price[0];
p = min([price_q,price_h,price_s]);
if price_d < p :
    if N%2 == 1 :
        ans = (N-1)//2*price_d + p//2;
    else :
        ans = N//2*price_d;
else :
    ans = N*p//2;

print(ans));
Problem p03013 (python)

Fixed submission:
n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
a = set(a)
mod = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
for i in range(2,n+1):
    if i not in a:
        dp[i] = dp[i-1]+dp[i-2]
print(dp[-1]%mod)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
if 1 in a and 2 in a:
    print(0)
    exit()
ans = 1
k = 0
if a[-1]!=n:
    a.append(n)

mod = 10**9+7
max = 10**5+1
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
for i in range( 2, max + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
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

for i in a:
    if i+1 in a:
        print(0)
        exit()
    else:
        if i-k<=2:
            m = 1
        elif i-k==3:
            m = 2
        else:
            m = 0
            f = i-k-1
            for j in range(f//2,-1,-1):
                m += cmb(f-j,j,mod)
        ans *= m
        ans %= mod
        k = i
print(ans%mod)
Problem p03038 (python)

Fixed submission:
n,m = map(int,input().split())
a = list(map(int,input().split()))
dict = {}
for i in range(n):
    if a[i] not in dict:
        dict[a[i]] = 0
    dict[a[i]] += 1
for _ in range(m):
    b,c = map(int,input().split())
    if c not in dict:
        dict[c] = 0
    dict[c] += b
keys = list(dict.keys())
keys = sorted(keys)[::-1]
ans = 0
cnt = 0
for i in range(len(keys)):
    if n-cnt<=dict[keys[i]]:
        ans += keys[i] * (n-cnt)
        break
    else:
        ans += keys[i] * dict[keys[i]]
        cnt += dict[keys[i]]
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k = map(int,input().split())
ans = 0
MOD = 10**9+7
for i in range(1,n):
    ans += i*(n-i)*(m**2)
for i in range(1,m):
    ans += i*(m-i)*(n**2)
from scipy.misc import comb
print((ans*comb(m*n-2,k-2,exact=True))%MOD)
Problem p03053 (python)

Fixed submission:
h,w = map(int,input().split())
a = [input() for _ in range(h)]
ans = 0
queue = []
for i in range(h):
    for j in range(w):
        if a[i][j]=='#':
            queue.append([i,j])
from collections import deque
queue = deque(queue)
dxy = [(0,1), (0,-1), (1,0), (-1,0)]
dp = [[10**4]*w for _ in range(h)]
for i,j in queue:
    dp[i][j] = 0
while len(queue):
    y,x = queue.popleft()
    d = dp[y][x]
    for dx,dy in dxy:
        nx, ny = x+dx, y+dy
        if not 0<=nx<=w-1:
            continue
        elif not 0<=ny<=h-1:
            continue
        elif dp[ny][nx]<=d+1:
            continue
        dp[ny][nx] = d+1
        queue.append((ny,nx))
print(max([max(dp[row]) for row in range(h)]))

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
a = ['#'*(w+2)]+['#'+input()+'#' for _ in range(h)]+['#'*(w+2)]
ans = 0
while True:
    l = []
    for i in range(1,h+1):
        for j in range(1,w+1):
            if a[i][j]=='#':
                l += [i,j]
    if len(l)==h*w:
        break
    ans += 1
    for l_ in l:
        a[l_[0]-1] = a[l_[0]-1][:l_[1]]+'#'+a[l_[0]-1][l_[1]+1:]
        a[l_[0]] = a[l_[0]][:l_[1]-1]+'###'+a[l_[0]][l_[1]+2:]
        a[l_[0]+1] = a[l_[0]+1][:l_[1]]+'#'+a[l_[0]+1][l_[1]+1:]
print(ans)
Problem p03054 (python)

Fixed submission:
h,w,n = map(int,input().split())
sr,sc = map(int,input().split())
s = input()
t = input()
wr = sc
wl = sc
hu = sr
hd = sr
def taka(k,wr,wl,hu,hd):
    if k=='U':
        hu -= 1
    if k=='D':
        hd += 1
    if k=='R':
        wr += 1
    if k=='L':
        wl -= 1
    return wr,wl,hu,hd
def ao(k,wr,wl,hu,hd):
    if k=='U':
        hd = max(1,hd-1)
    if k=='D':
        hu = min(h,hu+1)
    if k=='R':
        wl = min(w,wl+1)
    if k=='L':
        wr = max(1,wr-1)
    return wr,wl,hu,hd
for i in range(n):
    wr,wl,hu,hd = taka(s[i],wr,wl,hu,hd)
    if wl==0 or hu==0 or hd==h+1 or wr==w+1:
        print('NO')
        exit()
    wr,wl,hu,hd = ao(t[i],wr,wl,hu,hd)
print('YES')

Buggy submission (verdict: Runtime Error):
h,w,n = map(int,input().split())
sr,sc = map(int,input().split())
s = input()
t = input()
def taka(k,pos):
    if k=='U' and pos[0]-1<=h-pos[0]+1:
        pos[0] -= 1
    if k=='D' and h-pos[0]<=pos[0]:
        pos[0] += 1
    if k=='R' and w-pos[1]<=pos[1]:
        pos[1] += 1
    if k=='L' and pos[1]-1<=w-pos[1]+1:
        pos[1] -= 1
    return pos
def ao(k,pos):
    if k=='U' and pos[0]-1>=h-pos[0]+1:
        pos[0] -= 1
    if k=='D' and h-pos[0]>=pos[0]:
        pos[0] += 1
    if k=='R' and w-pos[1]>=pos[1]:
        pos[1] += 1
    if k=='L' and pos[1]-1>=w-pos[1]+1:
        pos[1] -= 1
    return pos
pos = [sr,sc]
for i in range(n):
    pos = taka(s[i],pos)
    if pos[0]<=0 or pos[1]=0 or pos[0]>h or pos[1]>w:
        print('NO')
        exit()
    pos = ao(t[i],pos)
print('YES')
Problem p03104 (python)

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

def f(x):
    if x<=0:
        return [0]
    k=2
    l = []
    while True:
        mul = k>>1
        if mul>x:
            fin = mul>>1
            l[-1]=x-fin+1
            break
        fin = mul>>1
        l.append(x//k*mul+max(x%k+1-k//2,0))
        k = k<<1
    l = l[::-1]
    return l
l1 = f(b)
l2 = f(a-1)
k=1
ans=0
while not l1==[]:
    if l2==[]:
        t = l1.pop()
        if t%2==1:
            ans+=k
    else:
        t = l1.pop()-l2.pop()
        if t%2==1:
            ans+=k
    k = k<<1
print(ans)

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

def f(x):
    if x==0:
        return [0]
    k=2
    l = []
    while True:
        mul = k>>1
        if mul>x:
            fin = mul>>1
            l[-1]=x-fin+1
            break
        fin = mul>>1
        l.append(x//k*mul+max(x%k+1-k//2,0))
        k = k<<1
    l = l[::-1]
    return l
l1 = f(b)
l2 = f(a-1)
k=1
ans=0
while not l1==[]:
    if l2==[]:
        t = l1.pop()
        if t%2==1:
            ans+=k
    else:
        t = l1.pop()-l2.pop()
        if t%2==1:
            ans+=k
    k = k<<1
print(ans)

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

def f(x):
    k=2
    l = []
    while True:
        mul = k>>1
        if mul>x:
            fin = mul>>1
            l[-1]=x-fin+1
            break
        fin = mul>>1
        l.append(x//k*mul+max(x%k+1-k//2,0))
        k = k<<1
    l = l[::-1]
    return l
l1 = f(b)
l2 = f(a-1)
k=1
ans=0
while not l1==[]:
    if l2==[]:
        t = l1.pop()
        if t%2==1:
            ans+=k
    else:
        t = l1.pop()-l2.pop()
        if t%2==1:
            ans+=k
    k = k<<1
print(ans)
Problem p03137 (python)

Fixed submission:
n,m = map(int,input().split())
x = list(map(int,input().split()))
x = sorted(x)
d = []
for i in range(len(x)-1):
    d.append(x[i+1]-x[i])
d = sorted(d)
if n==1:
    print(x[-1]-x[0])
elif n>=len(x):
    print(0)
else:
    dis = 0
    for i in range(n-1):
        dis+=d[-i-1]
    print(sum(d)-dis)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
x = list(map(int,input().split()))
x = sorted(x)
d = []
for i in range(len(x)-1):
    d.append(x[i+1]-x[i])
if n==1:
    print(x[-1]-x[0])
else:
    for i in range(n-1):
        d.remove(max(d))
    print(sum(d))
Problem p03201 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort()
from collections import Counter
dic = Counter(a)
ans = 0
for k in range(len(a)-1,-1,-1):
    if dic[a[k]]==0:
        continue
    dic[a[k]] -= 1
    t = 2**a[k].bit_length()-a[k]
    if dic[t]:
        dic[t] -= 1
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sort()
k = 1
twos = []
while k<2*10**5+1:
    twos += [k]
    k = k<<1
l = []
key = a[-1]
a.pop()
ans = 0
while True:
    for k in range(len(twos)-1):
        if twos[k]<key and key<twos[k+1]:
            two = twos[k+1]
            break
    for j in range(len(a)):
        if a[j]==two-key:
            a.remove(a[j])
            ans +=1
            break
    if not a==[]:
        key = a[-1]
        a.pop()
    else:
        break
print(ans)
Problem p03242 (python)

Fixed submission:
n = input()
for n_ in n:
    if n_=='1':
        print('9',end='')
    else:
        print('1',end='')
print()

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int,input().split()))
l1 = []
l2 = []
for i,v_ in enumerate(v):
    if i%2==0:
        l1.append(v_)
    else:
        l2.append(v_)

from collections import Counter
if set(l1)==set(l2):
    print(n//2)
else:
    c1 = Counter(l1).most_common(2)
    c2 = Counter(l2).most_common(2)
    if c1[0][0]==c2[0][0]:
        print(n-max(c1[0][1]+c2[1][1], c1[1][1]+c2[0][1]))
    else:
        print(n-c1[0][1]-c2[0][1])
Problem p03329 (python)

Fixed submission:
n = int(input())
c = [6**i for i in range(1,7)]
c.extend([9**i for i in range(1, 6)])
c = sorted(c)[::-1]
dp = [0]*1000000
for i in range(1,n+1):
    dp[i]=dp[i-1]+1
    for c_ in c:
        if i>=c_:
            dp[i]=min(dp[i],dp[i-c_]+1)
print(dp[n])

Buggy submission (verdict: Runtime Error):
n = int(input())
c = [6**i for i in range(1,7)]
c.extend([9**i for i in range(1, 6)])
c = sorted(c)[::-1]
dp = [0]*100000
for i in range(1,n+1):
    dp[i]=dp[i-1]+1
    for c_ in c:
        if i>=c_:
            dp[i]=min(dp[i],dp[i-c_]+1)
print(dp[n])
Problem p03426 (python)

Fixed submission:
h,w,d = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(h)]
q = int(input())
l = [list(map(int,input().split())) for _ in range(q)]
dic = {}
for i in range(len(a)):
    for j in range(len(a[i])):
        dic[a[i][j]] = (i,j)
sum = [0]*(h*w+1)
for i in range(d+1,h*w+1):
    sum[i] = sum[i-d]+abs(dic[i][0]-dic[i-d][0])+abs(dic[i][1]-dic[i-d][1])
for l_ in l:
    print(sum[l_[1]]-sum[l_[0]])

Buggy submission (verdict: Runtime Error):
h,w,d = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(h)]
q = int(input())
l = [list(map(int,input().split())) for _ in range(q)]
dic = {0:[0]}
for i in range(1,d+1):
    list = []
    for j in range(i,h*w,d):
        for y in range(len(a)):
            if j in a[y]:
                for x in range(len(a[y])):
                    if a[y][x]==j:
                        if i==j:
                            list.append(0)
                            x_ = x
                            y_ = y
                            k = 0
                        else:
                            k += abs(x-x_)+abs(y-y_)
                            list.append(k)
                            x_ = x
                            y_ = y
    dic[i] = list
print(dic)
for l_ in l:
    if l_[0]%d==0:
        print(dic[d][(l_[1]-l_[0])//d])
    else:
        print(dic[l_[0]%d][(l_[1]-l_[0])//d])

Buggy submission (verdict: Runtime Error):
h,w,d = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(h)]
q = int(input())
l = [list(map(int,input().split())) for _ in range(q)]
dic = {}
for i in range(1,h*w):
    list = []
    for j in range(i,h*w,d):
        for y in range(len(a)):
            if j in a[y]:
                for x in range(len(a[y])):
                    if a[y][x]==j:
                        if i==j:
                            list.append(0)
                            x_ = x
                            y_ = y
                            k = 0
                        else:
                            k += abs(x-x_)+abs(y-y_)
                            list.append(k)
                            x_ = x
                            y_ = y
    dic[i] = list
for l_ in l:
    print(dic[l_[0]][(l_[1]-l_[0])//d])
Problem p03803 (python)

Fixed submission:
a,b = map(int,input().split())
card = [2,3,4,5,6,7,8,9,10,11,12,13,1]
if card.index(a)==card.index(b):
  print('Draw')
elif card.index(a)>card.index(b):
  print('Alice')
else:
  print('Bob')

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a==b:
  print('Draw')
elif a==1:
  print('Alice')
elif b==1 or :
  print('Bob')
elif a>b:
  print('Alice')
else:
  print('Bob')
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())
c = a+b
print(6-c)

Buggy submission (verdict: Runtime Error):
s = int(input())
str1, str2 = [s for s in input().split()]
print(str1)
print(str2)
ans=[]
for i in range(s-1):
  ans += str1[i]
  ans += str2[i]

  
print(''.join(ans))
Problem p02880 (python)

Fixed submission:
A = int(input())
c = 0
for i in range(1,10):
  if (A % i == 0 and A // i < 10):
    c += 1
if c > 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A = int(input())
c = 0
for i in range(1,10):
  if (A % i == 0 and A // i < 10):
    c += 1
if c > 0:
  print("Yes")
else:
  print("No"
Problem p02881 (python)

Fixed submission:
import math
n = int(input())
n_s = int(math.sqrt(n))
for i in range(1, n_s+1):
    if n % i == 0:
        a = i
        b = n / i
        
print(int(a + b - 2))

Buggy submission (verdict: Runtime Error):
import fractions
A = int(input())
for i in range(2,A):
  a = fractions.gcd(A,i)
  b = A/a
  break
print(int(i + b -2))

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

for i in range(2,A):
  if (A % i == 0):
    a = i
    break

b = A / a
print(int(a+b-2))
Problem p03041 (python)

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

#print(S[K-1])
S = (S[:K-1] + S[K-1].lower() + S[K:])
print(S)

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

#print(S[K-1])
S = (S[:K-2]+S[K-1].lower()+S[K:]
print(S)

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

#print(S[K-1])
S = (S[:K-2]+S[K-1].lower()+S[K:]
print(S)

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())	
S = input()
S = S.replace(S[K],S[K].lower(),1)
print(S)

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

S = S.replace(S[K-1],S[K-1].lower())
print(S)
Problem p02879 (python)

Fixed submission:
# coding: utf-8
# Your code here!
x,y=input().split()

if int(x)<=0 or int(x)>=10 or int(y)<=0 or int(y)>=10:
    print("-1")
else:
    print(int(x)*int(y))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
x=input()
y=input()

if x<=0 or x>=10 or y<=0 or y>=10:
    print("-1")
else:
    print(x*y)
Problem p02659 (python)

Fixed submission:
a,b=input().split()
a=int(a)
b=b.replace(".","")
b=int(b)
ans=str(a*b)
if (len(ans)>=3):
    print(ans[:-2])
else:
    print(0)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
a=int(a)
b=int(float(b)*100)
print(string(a*b)[:-2])

Buggy submission (verdict: Runtime Error):
a,b=input().split()
a=int(a)
b=(float(b)*100)
print(string(a*b)[:-2])

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

Fixed submission:
import sys

s = sys.stdin.readline().rstrip()
t = sys.stdin.readline().rstrip()

count = 0
for i in range(len(s)):
  if s[i] != t[i]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
import sys
s = sys.stdin.readline().rstrip()
t = sys.stdin.readline().rstrip()

count = 0
for i in range(len(s)):
  if s[i] != s[t]:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
s = sys.stdin.readline().rstrip()
t = sys.stdin.readline().rstrip()

count = 0
for i in range(len(s)):
  if s[i] != s[t]:
    count += 1
print(count)