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

Fixed submission:
a,b =(int(i) for i in input().split())
result = a - (b*2)
if result > 0:
  print(result)
else:
  print("0")

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

try:
  print(a - (b*2))
else:
  print("0")
Problem p02830 (python)

Fixed submission:
n = int(input())
s, t = input().split()
 
res = ''
 
for i in range(n):
  res = res + str(s[i]) + str(t[i])
  
print(res)

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

res = ''

for i in range(n):
  res = res + str(S[i]) + str(T[i])
  
print(res)
Problem p02999 (python)

Fixed submission:
X ,a = map(int,input().split())
if X < a:
  print(0)
if X >= a :
  print(10)

Buggy submission (verdict: Runtime Error):
W,H,x,y= map(int,input().split())
big_square = W * H
square_1 = x * H
square_12 = big_square - square_1
if square_1 <= square_12:
  s = square_1
elif square_1> square_12:
  s = square_12

square_2 = W * y
square_22 = big_square - square_2
if square_2 <= square_22:
  t = square_2
elif square_2> square_22:
  t = square_22

if s<=t:
  big = t
else:
  big = s


  
if W == x *2 and H == y *2:
  way = 1
else:
  way = 0
  

print(big,way)
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input()split())
c =  a*b
if c%2 ==0:
  print('Even')
else:
  print('Odd')
Problem p03456 (python)

Fixed submission:
a,b = map (str,input().split())
c = a+b
s = int(c)
count=0
for i in range(400):
  if s == i ** 2:
    count += 1
  else:
    count+=0
if count>0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b = map (str,input().split())
s = a+b
for i in range(400):
  if s == i ** 2:
    count += 1
  else:
    count+=0
if count>1:
  print('Yes')
else:
  print('No')
Problem p03644 (python)

Fixed submission:
n=int(input())
sp = 0
sp_i=1
for i in range(1,n+1):
  s_i=i
  count =0
  a =True
  while a:
    if i % 2 ==0:
      i=i/2
      count += 1
    else:
      a =False
  if count >sp:
    sp = count
    sp_i = s_i
    
    
print(sp_i)

Buggy submission (verdict: Runtime Error):
n=int(input())
sp = 0
for i in range(1,n+1):
  s_i=i
  count =0
  a =True
  while a:
    if i % 2 ==0:
      i=i/2
      count += 1
    else:
      a =False
  if count >sp:
    sp = count
    sp_i = s_i
    
    
print(sp_i)
Problem p02830 (python)

Fixed submission:
n = int(input())
s, t = input().split()

merge = ''
for i in range(n):
  merge += s[i] + t[i]
  
print(merge)

Buggy submission (verdict: Runtime Error):
n = int(input())
s, t = input().split()

merge = ''
for i in range(n):
  metge += s[i] + t[i]
  
print(merge)
Problem p02885 (python)

Fixed submission:
A,B=input().split()
a=int(A)
b=int(B)
if a>=b*2:
  print(a-2*b)
else:
  print(0)

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

if A>=B*2:
  print(A-2*B)
else:
  print(0)

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

def jokyolist(s):
  jokyo=[]
  #jokyo配列はこれから除去すべき奴の番号のリスト
  for i in range(len(s)-1):
    if s[i]==s[i+1]:
      jokyo.append(i)
    jokyo=sorted(jokyo,reverse=True)
  return jokyo
 
def remov(s,jokyo):
  for i in range(len(jokyo)):
    s.pop(jokyo[i])
    return s
def removtimes(jokyo):
  t=len(jokyo)
  return t
 
i=0
while i<=n:
  jokyo=jokyolist(s)
  if removtimes(jokyo)==0:
    break
  s=remov(s,jokyo)
  i+=1

print(len(s))
Problem p02887 (python)

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

p=[]
#print(s)
for i in range(n-1):
  if s[i]==s[i+1]:
    p.append(i)
p.sort(reverse=True)
l=len(p)

for i in range(l):
    #print(p[i])
    s.pop(p[i])

print(len(s))

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


def jokyolist(s):
  jokyo=[]
  #jokyo配列はこれから除去すべき奴の番号のリスト
  for i in range(len(s)-1):
    if s[i]==s[i+1]:
      jokyo.append(i)
    jokyo=sorted(jokyo,reverse=TRUE)
  return jokyo

def remov(s,jokyo):
  for i in range(len(jokyo)):
    s.pop(jokyo[i])
    return s
def removtimes(jokyo):
  t=len(jokyo)
  return t


while:
  jokyo=jokyolist(s)
  if removtimes(jokyo)==0:
    break:
  s=remov(s,jokyo)

print(len(s))
Problem p02910 (python)

Fixed submission:
S=input()
s=list(S)
 
odd=[]
even=[]
 
for i in range(len(s)):
  if i%2==0:
    odd.append(s[i])
  if i%2==1:
    even.append(s[i])
 
    
oddsum=0
evensum=0
 
for i in range(len(odd)):
  if odd[i]=="R" or odd[i]=="U" or odd[i]=="D":
    oddsum+=1
  else:
    oddsum+=0
 
for i in range(len(even)):
  if even[i]=="L" or even[i]=="U" or even[i]=="D":
    evensum+=1
  else:
    evensum=0
 
if oddsum==len(odd) and evensum==len(even):
  print("Yes")
else:
  print("No")

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

odd=[]
even=[]

for i in range(n):
  if i%2==0:
    odd.append(s[i])
  if i%2==1:
    even.append(s[i])

    
oddsum=0
evensum=0

for i in range(len(odd)):
  if odd[i]=="R" or odd[i]=="U" or odd[i]=="D":
    oddsum+=1
  else:
    oddsum+=0

for i in range(len(even)):
  if even[i]=="L" or even[i]=="U" or even[i]=="D":
    evensum+=1
  else:
    evensum=0

if oddsum==len(odd) and evensum==len(even):
  print("Yes")
else:
  print("No")
Problem p02900 (python)

Fixed submission:
A, B = map(int, input().split())
max_num = 10**12
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

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)
    return a

r = gcd(A, B)
ans = len(set(prime_factorize(r)))+1
print(ans)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
max_num = 10**6
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

is_prime = [1 for i in range(max_num+1)]
primes = [0 for i in range(max_num+1)]
primes[0] = 2
index = 1
for i in range(3, max_num, 2):
    if is_prime[i] == 0:
        continue
    primes[index] = i
    index += 1
    for j in range(i, max_num, i):
        is_prime[j] = 0

r = gcd(A, B)
ans = 1
index = 0
while r != 1:
    mod = primes[index]
    if r % mod == 0:
        ans += 1
        i=1
        while r % mod**(i+1) == 0:
            i+=1
        r = r // mod**i
    index+=1
print(ans)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
max_num = 10**6
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

is_prime = [1 for i in range(max_num+1)]
primes = [0 for i in range(max_num+1)]
primes[0] = 2
index = 1
for i in range(3, max_num, 2):
    if is_prime[i] == 0:
        continue
    primes[index] = i
    index += 1
    for j in range(i, max_num, i):
        is_prime[j] = 0

r = gcd(A, B)
index = 0
while r != 1:
    if r % primes[index] == 0:
        r = r // primes[index]
    if r % primes[index] != 0:
        index+=1
print(index+1)
Problem p03000 (python)

Fixed submission:
N, X = map(int, input().split())
L = list(map(int, input().split()))
 
D = 0
cnt = 1
for i in range(N):
    D += L[i]
    if D <= X:
        cnt += 1
print(cnt)

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

cnt = 0
m = 0
while m <= X:
    m += L[cnt]
    cnt += 1

print(cnt)
Problem p03006 (python)

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

diffs = {(0,0):0}

for i in range(N):
    for j in range(N):
        if i==j:
            continue
        diff = (pos[j][0] - pos[i][0], pos[j][1] - pos[i][1])
        if diff not in diffs:
            diffs[diff] = 0
        diffs[diff] += 1

print(N-max(diffs.values()))

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

diffs = {}

for i in range(N):
    for j in range(i+1,N):
        diff = (pos[j][0] - pos[i][0], pos[j][1] - pos[i][1])
        if diff not in diffs:
            diffs[diff] = 0
        diffs[diff] += 1

print(N-max(diffs.values()))
Problem p03061 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
def gcd(a, b):
    P = max(a, b)
    Q = min(a, b)
    R = P%Q
    P = Q
    Q = R
    while R != 0:
        R = P%Q
        P = Q
        Q = R
    return P

candidate = [(gcd(A[0], A[1]), True), (A[0], False), (A[1], False)]
for i in range(2, N):
    nxt_cand = []
    for v, b in candidate:
        if(v == 1):
            continue
        if(b == True and gcd(v, A[i]) < v):
            nxt_cand.append((v, False))
            nxt_cand.append((gcd(v, A[i]), True))
        else:
            nxt_cand.append((gcd(v, A[i]), b))
    if(len(nxt_cand)==0):
        nxt_cand = [(1, False)]
    candidate = nxt_cand[::]

print(max(candidate)[0])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
def gcd(a, b):
    P = max(a, b)
    Q = min(a, b)
    R = P%Q
    P = Q
    Q = R
    while R != 0:
        R = P%Q
        P = Q
        Q = R
    return P

candidate = [(gcd(A[0], A[1]), True), (A[0], False), (A[1], False)]
for i in range(2, N):
    nxt_cand = []
    for v, b in candidate:
        if(v == 1):
            continue
        if(b == True and gcd(v, A[i]) < v):
            nxt_cand.append((v, False))
        else:
            nxt_cand.append((gcd(v, A[i]), b))
    candidate = nxt_cand[::]

print(max(candidate)[0])
Problem p03081 (python)

Fixed submission:
N, Q = map(int, input().split())
s = input()
td = [tuple(input().split()) for i in range(Q)]

def left_check(pos):
    nowpos = pos
    for t, d in td:
        if(d=="L" and t==s[nowpos]):
            nowpos -= 1
        elif(d=="R" and t==s[nowpos]):
            nowpos += 1
        if(nowpos == N):
            return False
        elif(nowpos == -1):
            return True
    return False

def right_check(pos):
    nowpos = pos
    for t, d in td:
        if(d=="L" and t==s[nowpos]):
            nowpos -= 1
        elif(d=="R" and t==s[nowpos]):
            nowpos += 1
        if(nowpos == N):
            return False
        elif(nowpos == -1):
            return True
    return True

def nibun(l, h, func):
    low = l
    high = h
    mid = (l+h)//2
    while low <= high:
        x = func(mid)
        if(x):
            low = mid+1
        else:
            high = mid-1
        mid = (low+high)//2
    return mid

print(nibun(0, N-1, right_check)-nibun(0, N-1, left_check))

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
s = input()
td = [tuple(input().split()) for i in range(Q)]

def left_check(pos):
    nowpos = pos
    for t, d in td:
        if(d=="L" and t==s[nowpos]):
            nowpos -= 1
        elif(d=="R" and t==s[nowpos]):
            nowpos += 1
        if(nowpos == -1):
            return True
    return False

def right_check(pos):
    nowpos = pos
    for t, d in td:
        if(d=="L" and t==s[nowpos]):
            nowpos -= 1
        elif(d=="R" and t==s[nowpos]):
            nowpos += 1
        if(nowpos == N):
            return False
    return True

def nibun(l, h, func):
    low = l
    high = h
    mid = (l+h)//2
    while low <= high:
        x = func(mid)
        if(x):
            low = mid+1
        else:
            high = mid-1
        mid = (low+high)//2
    return mid

print(nibun(0, N-1, right_check)-nibun(0, N-1, left_check))
Problem p03227 (python)

Fixed submission:
S = input()
print(S if len(S) == 2 else S[::-1])

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

print(100-100//n)
Problem p03293 (python)

Fixed submission:
S = input()
T = input()

ans = False
for i in range(len(S)):
    R = S[i:] + S[:i]
    if T == R:
        ans = True
        break

print("Yes" if ans else "No")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
print(max(A)-min(A))
Problem p03386 (python)

Fixed submission:
a, b, k = map(int, input().split())
if((b-a)//2>=k):
    for i in range(k):
        print(a+i)
    for i in range(k):
        print(b-k+i+1)
else:
    for i in range(a, b+1):
        print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
l = list(range(a, b+1))
for i in l:
    if(i<a+k or i>b-k):
        print(i)
Problem p03407 (python)

Fixed submission:
a, b, c = map(int, input().split())
print(["No","Yes"][a+b>=c])

Buggy submission (verdict: Runtime Error):
print(["No","Yes"][int(input())+int(input())>int(input())])
Problem p03423 (python)

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

Buggy submission (verdict: Runtime Error):
print(int(input()//3)
Problem p03494 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 10**9
for i in range(N):
    j = 0
    R = A[i] % 2
    B = A[i] // 2
    while(R==0):
        j += 1
        R = B % 2
        B = B // 2
    ans = min(j, ans)
    
print(ans)

Buggy submission (verdict: Runtime Error):
6
382253568 723152896 37802240 379425024 404894720 471526144
Problem p03591 (python)

Fixed submission:
S = input()
ans = "Yes" if S[0:4] == "YAKI" else "No"
print(ans)

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


def solve(N, M, K):
    for i in range(N+1):
        for j in range(M+1):
            blackNum = i*M + j*N - 2*i*j
            if K == blackNum:
                return "Yes"
    return "No"

print(solve(N, M, K))
Problem p03635 (python)

Fixed submission:
if __name__ == '__main__':
    n, m = map(int, input().split())
    print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    h, w = map(int, input().split())
    n = int(input())
    a = list(map(int, input().split()))

    c = [0] * (h*w)
    
    focus = 0
    for i in range(n):
        for j in range(a[i]):
            c[focus] = i+1
            focus += 1

    for i in range(h):
        for j in range(w):
            if(i%2 == 0):
                if(j + 1 != w):
                    print(c[i*w+j],end=" ")
                else:
                    print(c[i*w+j])
            else:
                if(j + 1 != w):
                    print(c[(i+1)*w-1-j],end=" ")
                else:
                    print(c[(i+1)*w-1-j])
Problem p03638 (python)

Fixed submission:
if __name__ == '__main__':
    h, w = map(int, input().split())
    n = int(input())
    a = list(map(int, input().split()))

    c = [0] * (h*w)
    
    focus = 0
    for i in range(n):
        for j in range(a[i]):
            c[focus] = i+1
            focus += 1

    for i in range(h):
        for j in range(w):
            if(i%2 == 0):
                if(j + 1 != w):
                    print(c[i*w+j],end=" ")
                else:
                    print(c[i*w+j])
            else:
                if(j + 1 != w):
                    print(c[(i+1)*w-1-j],end=" ")
                else:
                    print(c[(i+1)*w-1-j])

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    h, w = map(int, input().split())
    n = int(input())
    a = list(map(int, input().split()))

    c = [[0 for i in range(w)] for j in range(h)]
    vx = [1, -1, 0, 0]
    vy = [0, 0, 1, -1]
    color = 0

    def draw(x, y, num):
        sx, sy = x, y
        cnt = num
        queue = [(sx, sy)]
        while(len(queue)):
            if(not cnt):
                break
            cnt -= 1
            pos = queue.pop()
            c[pos[0]][pos[1]] = color + 1
            for i in range(4):
                if(pos[0]+vx[i]>=0 and pos[0]+vx[i]<h and
                   pos[1]+vy[i]>=0 and pos[1]+vy[i]<w and
                   c[pos[0]+vx[i]][pos[1]+vy[i]] == 0):
                    queue.append((pos[0]+vx[i], pos[1]+vy[i]))

    for i in range(h):
        for j in range(w):
            if(c[i][j] == 0):
                draw(i, j, a[color])
                color+=1

    print('\n'.join(' '.join([str(j) for j in i]) for i in c))
Problem p03680 (python)

Fixed submission:
n = int(input())
a = [int(input()) if(i) else 0 for i in range(n+1)]
distance = [None] * (n+1)
queue = [(1, 0)]
while(len(queue)):
    p, d = queue.pop()
    if(p==2):
        print(d)
        break
    if(distance[p]!=None or d==100001):
        print(-1)
        break
    distance[p] == d
    nextp = a[p]
    queue.append((nextp, d+1))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) if(i) else 0 for i in range(n+1)]
distance = [None] * (n+1)

def dfs(p, d):
    if(p==2):
        return d
    if(distance[p]!=None):
        return -1
    ans = 100001
    distance[p] = d
    nextp = a[p]
    ans = min(ans, dfs(nextp, d + 1))
    return ans

print(dfs(1, 0))
Problem p03697 (python)

Fixed submission:
a, b = map(int, input().split())
ans = "error" if(a + b >= 10) else a + b
print(ans)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().spkit())
ans = "error" if(a + b >= 10) else a + b
print(ans)
Problem p03700 (python)

Fixed submission:
from math import ceil
n, a, b = map(int, input().split())
h = [int(input()) for i in range(n)]

def enough(t):
    count = 0
    for hp in h:
        count += ceil(max(0, hp - b*t) / (a-b))
    if(count <= t):
        return True
    else:
        return False


high = ceil(max(h)/b)
low = 0
while(high - low > 0):
    mid = (high + low) // 2
    if(enough(mid)):
        high = mid
    else:
        low = mid + 1
print(low)

Buggy submission (verdict: Runtime Error):
from math import ceil
n, a, b = map(int, input().split())
h = [int(input()) for i in range(n)]

def enough(t):
    count = 0
    for hp in h:
        count += ceil(max(0, hp - b*t) / (a-b))
    if(count <= t):
        return True
    else:
        return False


high = ceil(max(h)/b)
low = 0
while(high - low > 1):
    mid = (high + low) // 2
    if(enough(mid)):
        high = mid
    else:
        low = mid
print(mid)
Problem p03720 (python)

Fixed submission:
N, M = map(int, input().split())
adj_nums = [0 for i in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    adj_nums[a-1] += 1
    adj_nums[b-1] += 1

for i in adj_nums:
    print(i)

Buggy submission (verdict: Runtime Error):
8 8
1 2
3 4
1 5
2 8
3 7
5 2
4 1
6 8
Problem p03781 (python)

Fixed submission:
N = int(input())

for t in range(10**5):
    if t*(t+1)/2 >= N:
        print(t)
        break

Buggy submission (verdict: Runtime Error):
def reduce (last, count, time):
    if last == 0:
        return time-1
    if last-time==0 or last-time > time:
        return reduce(last-time, count+1, time+1)
    else:
        return reduce(last, count, time+1)
        

if __name__ == '__main__':
    X = int(input())
    ret = reduce(X, 0, 1)
    print(ret)
Problem p03861 (python)

Fixed submission:
a, b, x = map(int, input().split())
print(b//x-(a-1)//x)

Buggy submission (verdict: Runtime Error):
a, b, x = map(int, input().split())
print((b-a)//x+((a%x==0)or(b%x==0))
Problem p02848 (python)

Fixed submission:
n = int(input())
s = str(input())
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ss = ''

for i in range(len(s)):

    ss += str(alp[alp.index(s[i])+n])

print(ss)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
alp = 'abcdefghijklmnopqrstuvwxyz' * 2
ss = ''

for i in range(len(s)):

    ss += str(alp[alp.index(s[i])+n])

print(ss)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
alp = 'abcdefghijklmnopqrstuvwxyz' * 2
lst = []

for i in range(len(s)):

    lst.append(str(alp[alp.index(s[i])+n]))

print(''.join(lst))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
alp = 'abcdefghijklmnopqrstuvwxyz' * 2
lst = []

for i in range(len(s)):

    lst.append(alp[alp.index(s[i])+n])

print(''.join(lst))
Problem p02885 (python)

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

c = a - 2 * b

print(c if c > 0 else 0)

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

c = a - 2b

if c > 0:
  print(c)
  
else:
  print(0)

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

c = a - 2b

print(c if c > 0 else 0)

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

c = a - 2b

print(c if c > 0 else 0)
Problem p02898 (python)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
tmp = 0

for i in range(n):

    if h[i] >= k:
        tmp += 1

print(tmp)

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

for i in range(n):

    if h[i] >= k:
        tmp += 1

print(tmp)
Problem p02910 (python)

Fixed submission:
s = str(input())
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']
tmp = 0

for i in range(len(s)):
    if i%2==0 and s[i] in odd:
        tmp += 1
    elif i%2!=0 and s[i] in even:
        tmp += 1

print('Yes' if tmp==len(s) else 'No')

Buggy submission (verdict: Runtime Error):
s = str(input())
odd = ['R', 'U', 'D]
even = ['L', 'U', 'D']
tmp = 0

for i in range(len(s)):

    if i%2!=0 and s[i] in odd:
       tmp += 1
    elif i%2==0 and s[i] in even:
        tmp += 1

print('Yes' if tmp==len(s) else 'No')
Problem p02921 (python)

Fixed submission:
s = str(input())
t = str(input())

if s[0] == t[0]:
    a = 1
else:
    a = 0

if s[1] == t[1]:
    b = 1
else:
    b = 0

if s[2] == t[2]:
    c = 1
else:
    c = 0

print(a + b + c)

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

if b==1:
    tmp = 0

else:
    tmp = 1

    while tmp*a-tmp+1 < b:
        tmp += 1

print(tmp)
Problem p02922 (python)

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

if b==1:
    tmp = 0

else:
    tmp = 1

    while tmp*a-tmp+1 < b:
        tmp += 1

print(tmp)

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

if b==1:
    tmp = 0

else:
    tmp = 1

    while tmp*a-tmp+1 < b:
    tmp += 1

print(tmp)
Problem p03035 (python)

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

if a > 12:
    print(b)

elif 5 < a < 13:
    print(b // 2)

else:
    print(0)

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

if a > 12:
    print(b)

eilf 5 < a < 13:
    print(b // 2)

else:
    print(0)
Problem p03071 (python)

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

if a >= b:
    print(a + max(a-1, b))

else:
    print(b + max(a, b-1))

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

if a >= b:
    c = a - 1
    k = max(c,b)
    print(a+k)

else:
    c = b - 1
    k = max(a,c)
    print(b+k)

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

if a >= b:
    k = max(a-1, b)
    print(a+k)

else:
    k = max(a, b-1)
    print(b+k)

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

if a >= b:
    k = a-1
    print(a + max(k,b))

else:
    k = b-1
    print(b + max(a,k))

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

if a >= b:
    c = a
    a = a-1
    print(c + max(a,b))

else:
    c = b
    b = b-1
    print(c + max(a,b))
Problem p03109 (python)

Fixed submission:
s = input()
s1 = [s[0], s[1], s[2], s[3]]
s2 = [s[5], s[6]]

t1 = int(''.join(s1))
t2 = int(''.join(s2))

if t1 > 2019:
    print('TBD')

elif t1 == 2019 and t2 > 4:
    print('TBD')

else:
    print('Heisei')

Buggy submission (verdict: Runtime Error):
s = list(input())
k = [s[0], s[1], s[2], s[3]]
l = [s[5], s[6]]
a = ''.join(int(_) for _ in k)
b = ''.join(int(_) for _ in l)

if a > 2019:
    print('TBD')

elif a == 2018 and b > 4:
    print('TBD')

else:
    print('Heisei')

Buggy submission (verdict: Runtime Error):
s = list(input(s))
k = [s[0], s[1], s[2], s[3]]
l = [s[5], s[6]]
a = int(''.join(k))
b = int(''.join(l))

if a > 2019:
    print('TBD')

elif a == 2018 and b > 4:
    print('TBD')

else:
    print('Heisei')
Problem p03206 (python)

Fixed submission:
D = int(input())
dic = {22:'Christmas Eve Eve Eve', 23:'Christmas Eve Eve', 24:'Christmas Eve', 25:'Christmas'}
print(dic[D])

Buggy submission (verdict: Runtime Error):
D = input()
dic = {22:'Christmas Eve Eve Eve', 23:'Christmas Eve Eve', 24:'Christmas Eve', 25:'Christmas'}
print(dic[D])