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

Fixed submission:
from collections import defaultdict
d = defaultdict(int)
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
     'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

S = input()
if S == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()

if len(S) < 26:
    for x in S:
        d[x] += 1
    for x in a:
        if d[x] == 0:
            print(S+x)
            exit()
else:
    i = 25
    while S[i-1] > S[i]:
        i -= 1
    ss = sorted(list(S[i-1:]))
    t = S[i-1]
    print(S[:i-1] + ss[ss.index(t)+1])

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
d = defaultdict(int)
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
     'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

S = input()
if S == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()

if len(S) < 26:
    for x in S:
        d[x] += 1
    for x in a:
        if d[x] == 0:
            print(S+x)
            exit()
else:
    b = 25
    for i in range(24, 0, -1):
        if S[i] > S[i+1]:
            b = i-1
            break
    ss = sorted(list(S[b-1:]))
    t = S[b-1]
    print(S[:b-1] + ss[ss.index(t)+1])

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
d = defaultdict(int)
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
     'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

S = input()
if S == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()

if len(S) < 26:
    for x in S:
        d[x] += 1
    for x in a:
        if d[x] == 0:
            print(S+x)
            exit()
else:
    index = 25
    for i in range(25):
        if S[i] > S[i+1]:
            index = i
            break
    ss = sorted(S[index-1:])
    print(S[:index-1] + ss[ss.index(S[i-1])+1])

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
d = defaultdict(int)
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
     'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

S = input()
if S == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()

if len(S) < 26:
    for x in S:
        d[x] += 1
    for x in a:
        if d[x] == 0:
            print(S+x)
            exit()
else:
    index = 25
    for i in range(25):
        if S[i] > S[i+1]:
            index = i
            break
    ss = sorted(S[index-1:])
    print(S[:index-1] + ss[1])
Problem p03563 (python)

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

Buggy submission (verdict: Runtime Error):
r = int(input())
g = int(input())
print(2 * g - r
Problem p03569 (python)

Fixed submission:
s = input()
count = 0
if len(set(s)) == 1:
    print(0)
    exit()
left = 0
right = len(s) - 1

ans = 0
while True:
    if (s[left] == 'x' and s[right] == 'x') or s[left] == s[right]:
        left += 1
        right -= 1
    elif s[left] == 'x' and s[right] != 'x':
        ans += 1
        left += 1
    elif s[left] != 'x' and s[right] == 'x':
        ans += 1
        right -= 1
    elif s[left] != 'x' and s[right] != 'x' and s[left] != s[right]:
        print(-1)
        exit()
    if right <= left:
        break
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
count = 0
if len(set(s)) == 1:
    print(0)
    exit()
left = 0
right = len(s) - 1

ans = 0
while True:
    if (s[left] == 'x' and s[right] == 'x') or s[left] == s[right]:
        left += 1
        right -= 1
    elif s[left] == 'x' and s[right] != 'x':
        ans += 1
        left += 1
    elif s[left] != 'x' and s[right] == 'x':
        ans += 1
        right -= 1
    elif s[left] != 'x' and s[right] != 'x' and s[left] != s[right]:
        print(-1)
        exit()
    if left == right:
        break
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
rev_s = s[::-1]
count = 0
if len(set(s)) == 1:
    print(0)
    exit()
left = 0
right = len(s) - 1

ans = 0
while True:
    if (s[left] == 'x' and s[right] == 'x') or s[left] == s[right]:
        left += 1
        right -= 1
    if s[left] == 'x' and s[right] != 'x':
        ans += 1
        left += 1
    elif s[left] != 'x' and s[right] == 'x':
        ans += 1
        right -= 1
    elif s[left] != 'x' and s[right] != 'x' and s[left] != s[right]:
        print(-1)
        exit()
    if left == right:
        break
print(ans)
Problem p03633 (python)

Fixed submission:
def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b

def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = x * a[i] // gcd(x, a[i])
    return x

n = int(input())
t = [int(input()) for _ in range(n)]
print(lcm(t))

Buggy submission (verdict: Runtime Error):
import math

def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = x * a[i] // math.gcd(x, a[i])
    return x

n = int(input())
t = [int(input()) for _ in range(n)]
print(lcm(t))
Problem p03739 (python)

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


def check(op):  # 最初の数の正負を引数とする
    total = 0
    ans = 0
    for i in range(0, n):
        if (total+a[i]) > 0 and op == "+":
            ans += abs(-1 - (total + a[i]))
            total = -1
            op = "-"
        elif (total+a[i]) < 0 and op == "-":
            ans += abs(1 - (total + a[i]))
            total = 1
            op = "+"
        elif total+a[i] == 0:
            ans += 1
            if op == "+":
                total = -1
                op = "-"
            else:
                total = 1
                op = "+"
        else:
            total += a[i]
            if op == "+":
                op = "-"
            else:
                op = "+"
    return ans


print(min(check("+"), check("-")))

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

ans = 0
if a[0] > 0:
    op = "+"
elif a[0] < 0:
    op = "-"
elif a[0] == 0:
    ans += 1
    if a[1] > 0:
        a[0] = -1
    else:
        a[0] = 1

total = a[0]
for i in range(1, n):
    if (total+a[i]) >= 0 and op == "+":
        ans += abs((-1 - total) - a[i])
        total = -1
        op = "-"
    elif (total+a[i]) < 0 and op == "-":
        ans += abs((1 - total) - a[i])
        total = 1
        op = "+"
    elif total+a[i] == 0:
        ans += 1
        if a[1] > 0:
            a[0] = -1
        else:
            a[0] = 1
    else:
        total += a[i]
        if op == "+":
            op = "-"
        else:
            op = "+"
print(ans)
Problem p03854 (python)

Fixed submission:
s = input()
t = ''
add_list = ['dream', 'dreamer', 'erase', 'eraser']
cur = len(s)
for i in range(len(s)):
    if s[-1 - i:cur] in add_list:
        cur = -1 - i
if -cur == len(s):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a = input().split()
print(a[0][0] + a[1][0] + a[2][0])
Problem p02747 (python)

Fixed submission:
s = input()
p = "No"
a = 0
if len(s) % 2 == 0:
  for i in range(len(s)//2):
    if str(s[a]+s[a+1]) == "hi":
      p = "Yes"
      a = a + 2
    else:
      p = "No"
      break;
print(p)

Buggy submission (verdict: Runtime Error):
s = input()
p = "No"
a = 0
if len(s) % 2 == 0:
  for i in range(len(s)//2+1):
    if str(s[a]+s[a+1]) == "hi":
      p = "Yes"
      a = a + 2
    else:
      p = "No"
      break;
print(p)
Problem p03423 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
L = list(map(str, input().split()))
b = 'Three'
for i in range(a):
  if L[i] == 'Y':
    b = 'Four'
    break
print(b)
Problem p02850 (python)

Fixed submission:
import sys
sys.setrecursionlimit(500000)

N = int(input())
G = [[] for _ in range(N+1)]

for i in range(N-1):
    a, b = map(int, input().split())
    G[a].append((b, i))
    G[b].append((a, i))

color = max(len(g) for g in G)
print(color)

ans = [-1] * (N-1)

def dfs(v=1, p=0, p_col=-1):
    col = 1

    for side, idx in G[v]:
        if side != p:
            if col == p_col:
                col += 1
            ans[idx] = col
            dfs(side, v, col)
            col += 1

dfs()
print("\n".join(map(str, ans)))

Buggy submission (verdict: Runtime Error):
N = int(input())
G = [[] for _ in range(N+1)]

for i in range(N-1):
    a, b = map(int, input().split())
    G[a].append((b, i))
    G[b].append((a, i))

color = max(len(g) for g in G)
print(color)

ans = [-1] * (N-1)

def dfs(v=1, p=0, p_col=-1):
    col = 1

    for side, idx in G[v]:
        if side != p:
            if col == p_col:
                col += 1
            ans[idx] = col
            dfs(side, v, col)
            col += 1

dfs()
print("\n".join(map(str, ans)))
Problem p02921 (python)

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

ans = 0

for i in range(3):
    if S[i] == T[i]:
        ans += 1

print(ans)

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

if N == 1:
    print(0)
elif N == 2:
    print(1)
else:
    ans = int((N*(N-1))/2)
    print(ans)
Problem p03047 (python)

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

print(N-K+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
eni_B = 0
end_A = 0
both = 0
count = 0

for i in range(N):
    s = list(input())
    if s[0] == 'B':
        eni_B += 1
    if s[-1] == 'A':
        end_A += 1
    if s[0] == 'B' and s[-1] == 'A':
        eni_B -= 1
        end_A -= 1
        both += 1
    for j in range(len(s)-1):
        if s[j] == 'A':
            if s[j+1] == 'B':
                count += 1


if end_A != 0 or eni_B != 0:
    count = count + min(end_A,eni_B) + both
    print(count)
else :
    print(count)
Problem p03061 (python)

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

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b, a % b)

res = [0] * N
l = [0] * (N+1)
r = [0] * (N+1)

for i in range(N):
    l[i+1] = gcd(l[i],A[i])

for i in range(N,0,-1):
    r[i-1] = gcd(r[i],A[i-1])

for i in range(N):
    res[i] = gcd(l[i],r[i+1])

print(max(res))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
count = 0
B = []
b = 0

A.sort()
b = A[0]

while True:

    if len(A) == 1:
        break
    
    else:
        for i in range(len(A)):
            A[i] = A[i] % b
        
        A = set(A)
        A = list(A)
    
        for j in range(len(A)):
                if int(A[j]) != 0:
                    B.append(int(A[j]))
    
        B.sort()
    
        b = B[0]
        b_max = B[-1]


print(b_max)
Problem p03067 (python)

Fixed submission:
A,B,C = map(int,input().split())

if A<C and C<B:
    print('Yes')
elif B<C and C<A:
    print('Yes')
else:
    print('No')

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

if N == 1:
    print('Hello World')
else:
    A = int(input())
    B = int(input())
    print(int(A+B))
Problem p03071 (python)

Fixed submission:
A,B = map(int,input().split())
coin = 0

if A > B :
    coin = coin + A
    A = A-1
    if A > B:
        coin = coin +A
    else : 
        coin = coin + B
elif B >=A :
    coin = coin + B
    B = B-1
    if A > B:
        coin = coin + A
    else :
        coin = coin + B
    
print(coin)

Buggy submission (verdict: Runtime Error):
import numpy

s = list(input())
N = len(s)
count_A = 0
count_B = 0

for i in range(N):
    s[i] = int(str(s[i]))

A = numpy.empty(N)
B = numpy.empty(N)

for j in range(N):
    if j % 2 == 0 :
        A[j] = 1
        B[j] = 0
    else:
        A[j] = 0
        B[j] = 1

for k in range(N):
    A[k]=s[k]-A[k]
    B[k]=s[k]-B[k]
    if A[k] != 0:
        count_A = count_A + 1
    if B[k] != 0:
        count_B = count_B + 1

if count_A > count_B :
    print(count_B)
else :
    print(count_A)
Problem p03076 (python)

Fixed submission:
dish_time = [int(input()) for i in range(5)]
rest=[0,0,0,0,0]
last_min=[]

for j in range(5):
    rest[j] = dish_time[j] - (dish_time[j]//10*10)
    if rest[j] != 0:
        dish_time[j] = (dish_time[j]//10 + 1 ) *10   
        last_min.append(rest[j])

sum_time =  0

for i in range(5):
    sum_time = sum_time + dish_time[i]

if len(last_min) != 0:
    sum_time = sum_time + min(last_min) - 10
    print(sum_time)
else :
    sum_time = sum_time
    print(sum_time)

Buggy submission (verdict: Runtime Error):
dish_time = [int(input()) for i in range(5)]
rest=[0,0,0,0,0]
last_min=[]

for j in range(5):
    rest[j] = dish_time[j] - (dish_time[j]//10*10)
    if rest[j] != 0:
        dish_time[j] = (dish_time[j]//10 + 1 ) *10   
        last_min.append(rest[j])

sum_time =  0

for i in range(5):
    sum_time = sum_time + dish_time[i]

sum_time = sum_time + min(last_min) - 10
    
print(sum_time)
Problem p03164 (python)

Fixed submission:
N,W=map(int,input().split())
w=[]
v=[]
for i in range(N):
    a,b=map(int,input().split())
    w.append(a)
    v.append(b)
dp=[[10**22]*(N*(10**3)+1) for i in range(N+1)]
dp[0][0]=0
for i in range(1,N+1):
    for j in range(N*(10**3)+1):
        if j>=v[i-1]:
            dp[i][j]=min(dp[i-1][j-v[i-1]]+w[i-1],dp[i-1][j])
        else:
            dp[i][j]=dp[i-1][j]
for i in range(N*(10**3),-1,-1):
    if dp[N][i]<=W:
        print(i)
        break

Buggy submission (verdict: Runtime Error):
N, W = map(int, input().split())
w = []
v = []
Vmax = 100 * N

for i in range(N):
    a, b = map(int, input().split())
    w.append(a)
    v.append(b)

inf = float('inf')
dp = [[inf] * (Vmax+1) for _ in range(N)]
dp[0][0] = 0
dp[0][v[0]] = w[0]

for i in range(1,N):
    for j in range(Vmax):

        if dp[i-1][j] != inf:
            dp[i][j] = dp[i-1][j]

            if dp[i-1][j] + w[i] <= W:
                dp[i][j+v[i]] = min(dp[i][j+v[i]], dp[i-1][j] + w[i])
        
ans = 0
for j in range(Vmax):
    if dp[N-1][j] <= W:
        ans = j

print(ans)

Buggy submission (verdict: Runtime Error):
def chmin(a,b):
    if a > b:
        return b
    else:
        return a

N, W = map(int, input().split())
w = []
v = []
Vmax = 100 * N

for i in range(N):
    a, b = map(int, input().split())
    w.append(a)
    v.append(b)

inf = float('inf')
dp = [[inf] * (Vmax+1) for _ in range(N)]
dp[0][0] = 0
dp[0][v[0]] = w[0]

for i in range(1,N):
    for j in range(Vmax):

        if dp[i-1][j] != inf:
            dp[i][j] = dp[i-1][j]

            if dp[i-1][j] + w[i] <= W:
                dp[i][j+v[i]] = chmin(dp[i][j+v[i]], dp[i-1][j] + w[i])
        
for j in range(Vmax):
    if dp[N-1][j] != inf:
        ans = j

print(ans)

Buggy submission (verdict: Runtime Error):
def chmin(a,b):
    if a > b:
        return b
    else:
        return a

N, W = map(int, input().split())
w = []
v = []
Vmax = 100 * N

for i in range(N):
    a, b = map(int, input().split())
    w.append(a)
    v.append(b)

inf = float('inf')
dp = [[inf] * (Vmax+1) for _ in range(N)]
dp[0][0] = 0
dp[0][v[0]] = w[0]

for i in range(1,N):
    for j in range(Vmax):

        if dp[i-1][j] != inf:
            dp[i][j] = dp[i-1][j]

            if dp[i-1][j] + w[i] <= W:
                dp[i][j+v[i]] = chmin(dp[i][j+v[i]], dp[i-1][j] + w[i])
        
for j in range(Vmax):
    if dp[N-1][j] != inf:
        ans = j

print(ans)
Problem p03166 (python)

Fixed submission:
N, M = map(int, input().split())
G = [[] for _ in range(N)]
in_G = [0] * N

for i in range(M):
    x, y = map(int, input().split())
    G[x-1].append(y-1)
    in_G[y-1] += 1

dist = [0] * N
q = [x for x in range(N) if in_G[x] == 0]

while q:
    v = q.pop()

    for g in G[v]:
        dist[g] = max(dist[g], dist[v] + 1)
        in_G[g] -= 1
        if in_G[g] == 0:
            q.append(g)

print(max(dist))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
G = [[] for _ in range(N)]
in_G = [0] * N

for i in range(M):
    x, y = map(int, input().split())
    G[x-1].append(y-1)
    in_G[y-1] += 1

dist = [0] * N
q = [x for x in range(N) if in_G[x] == 0]

while q:
    v = q.pop

    for g in G[v]:
        dist[g] = max(dist[g], dist[v] + 1)
        in_G[g] -= 1
        if in_G[g] == 0:
            q.append(g)

print(max(dist))
Problem p03239 (python)

Fixed submission:
N , T = map(int,input().split())
C=[]

for i in range(N):
    c ,t = map(int,input().split())
    if t <= T :
        C.append(c)

C.sort()
if len(C)==0:
    print('TLE')
else:
    print(C[0])

Buggy submission (verdict: Runtime Error):
N , T = map(int,input().split())
C=[]

for i in range(N):
    c , t = map(int,input().split())
    if t <= T :
        C.append(c)

C.sort()
print(C[0])
Problem p03355 (python)

Fixed submission:
S = input()
K = int(input())
x = set()

for i in range(len(S)):
    for j in range(1,min(len(S) - i + 1, K + 1)):
        x.add(S[i:i + j])

x = list(x)
x.sort()
print(x[K - 1])

Buggy submission (verdict: Runtime Error):
S = list(input())
K = int(input())
x = set()

for i in range(len(S)):
    for j in range(1,min(len(S) - i + 1, K + 1)):
        x.add(S[i:i + j])

x = list(x)
x.sort()
print(x[K - 1])
Problem p03633 (python)

Fixed submission:
N = int(input())
T = []

for i in range(N):
    T.append(int(input()))

a = 1

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)

for i in range(N):
    a = a * T[i] // gcd(a,T[i])

print(a)

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

for i in range(N):
    T.append(int(input()))

a = 1

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)

for i in range(N):
    d = gcd(a, T[i])
    a = int(a * T[i] / d)

print(a)

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

for i in range(N):
    T.append(int(input()))

T.sort
a = T[0]

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)

for i in range(N-1):
    d = gcd(a, T[i+1])
    a = int(a * T[i+1] / d)

print(a)

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

for i in range(N):
    T.append(int(input()))

T.sort
a = T[0]

def gcd(a,b):
    if b == 0:
        return a
    else:
        c = a % b
        a = max(b,c)
        b = min(b,c)
        return gcd(a,b)

for i in range(N-1):
    d = gcd(a, T[i+1])
    a = int(a * T[i+1] / d)

print(int(a))

Buggy submission (verdict: Runtime Error):
import fractions

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

for i in range(N):
    T.append(int(input()))

T.sort
a = T[0]

for i in range(N-1):
    gcd = fractions.gcd(a, T[i+1])
    a = int(a * T[i+1] / gcd)

print(int(a))

Buggy submission (verdict: Runtime Error):
import math
import fractions

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

for i in range(N):
    T.append(int(input()))

T.sort
a = T[0]

for i in range(N-1):
    gcd = math.gcd(a, T[i+1])
    a = int(a * T[i+1] / gcd)

print(int(a))

Buggy submission (verdict: Runtime Error):
import math

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

for i in range(N):
    T.append(int(input()))

T.sort
a = T[0]

for i in range(N-1):
    gcd = math.gcd(a, T[i+1])
    a = int(a * T[i+1] / gcd)

print(int(a))
Problem p02555 (python)

Fixed submission:
S = int(input())
mod = 10**9+7

dp = [1]+[0]*S

for i in range(1, S+1):
    for j in range(0, i-2):
        dp[i] += dp[j]

print(dp[S]%mod)

Buggy submission (verdict: Runtime Error):
S = int(input())
mod = 10**9+7

dp = [1]+[0]*(S-1)

for i in range(0, S+1):
    for j in range(3, S-2):
        dp[i] += dp[j]

print(dp[S]%mod)
Problem p02681 (python)

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

if T.startswith(S):
    print("Yes")
else:
    print("No")

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

if T.startwith('S'):
    print("Yes")
else:
    print("No")
Problem p03292 (python)

Fixed submission:
*a, = map(int,input().split())
print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
*a = map(int,input().split())
print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
*a = map(int,input.split())
print(max(a) - min(a))
Problem p03423 (python)

Fixed submission:
a = int(input())
b = a % 3
print(int((a - b) / 3))

Buggy submission (verdict: Runtime Error):
a = map(int,input())
a % 3 = b
print((a-b)/3)
Problem p03455 (python)

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

if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")

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

if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")

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

if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03493 (python)

Fixed submission:
print(int(input()) % 9)

Buggy submission (verdict: Runtime Error):
count = 0
a = str(input())
print(a)
for i in range(len(a))
if a[i] == 1:
    count = count + 1

Buggy submission (verdict: Runtime Error):

count = 0
s = [input() for i in range(0,3)] #複数行の数値の入力を取得

if s[i]=1:
    count += 1
    
else:
    count = count
Problem p03543 (python)

Fixed submission:
a,b,c,d = input()
if a == b == c or b == c == d:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d = input()
print("Yes if a == b == c or b == c ==d else "No")

Buggy submission (verdict: Runtime Error):
a, b, c, d = input()
print("Yes" if a = b = c or b = c = d else "No")
Problem p03636 (python)

Fixed submission:
a, *b, c = input()
print(a + str(len(b)) + c)

Buggy submission (verdict: Runtime Error):
a, *b, c = input()
print(a + str(len(b) + c)
Problem p03777 (python)

Fixed submission:
a,_,b = input()
if a == b:
    print("H")
else:
    print("D")

Buggy submission (verdict: Runtime Error):
a,b = input().split()
if a == b:
print("H")
else:
print("D")
Problem p02612 (python)

Fixed submission:
n=int(input())
if n%1000==0:
  print(0)
else:
  print((n//1000+1)*1000-n)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=0
b=0
c=0
d=0
for i in range(n):
  s=input()
  if s=="AC":
    a=a+1
  if s=="WA":
    b=b+1
  if s=="TLE":
    c=c+1
  if s=="RE":
    d=d+1
print("AC*a""WA*b""TLE*c""RE*d)
Problem p02700 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if a%d>0:
   a=a//d+1
elif a%d==0:
   a=a//d
if c%b>0:
  c=c//b+1
elif c%b==0:
  c=c//b
if a>=c:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if a%d>0:
   a=a//d+1
elif a%d==0:
   a=a//d
if c%b>0:
   c=c//b+1
elif c%b==0
if a>=c:
   print("yes")
else:
   print("no")
Problem p02783 (python)

Fixed submission:
h,a=map(int,input().split())
if h>a:
  if h%a==0:print(h//a)
  if h%a>0:print(h//a+1)
if h<=a:
  print(1)

Buggy submission (verdict: Runtime Error):
h,a=map(int,input.split())
if h>a:
  print(h//a)
if h<=a:
  print(1)

Buggy submission (verdict: Runtime Error):
h,a=map(int,input.split())
if h>a:
  print(h//a)
if h<a:
  print(1)
Problem p02789 (python)

Fixed submission:
n,m=map(int,input().split())
if n==m:
   print("Yes")
else:
   print("No")

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
if n == m
   print("Yes")
else:
   print("No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
if n==m
   print("Yes")
else:
   print("No")
Problem p02922 (python)

Fixed submission:
a,b=map(int,input().split())
if (b-1)%(a-1)>0:
  print((b-1)//(a-1)+1)
if (b-1)%(a-1)==0:
  print((b-1)//(a-1))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if b>a:if b%a>0:print(b//a+1)
elif b<=a:print(1)
else:print(b//a)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if b%a>0:print(b//a+1)
elif a=b:print(1)
else:print(b//a)
Problem p03337 (python)

Fixed submission:
a, b = map(int, input().split())
print(max(a + b, a * b, a - b))

Buggy submission (verdict: Runtime Error):
a, b = map(imt, input().split())
print(max(a + b, a * b, a - b))
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(imt, input().split())
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")
Problem p03623 (python)

Fixed submission:
x, a, b = map(int, input().split())
print("A" if max(x, a) - min(x, a) < max(x, b) - min(x, b) else "B")

Buggy submission (verdict: Runtime Error):
x, a, b = map(int, input.split())
print("A" if max(x, a) - min(x, a) < max(x, b) - min(x, b) else "B")