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

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

m = str(int(s[0]) - 1) + (len(s) - 1) * "9" 
ans1 = 0
for i in range(len(m)):
    ans1 += int(m[i])

if s[-1] != "9" and n >= 10:
    n1 = n - (int(s[-1]) + 1)
    s = str(n1)

ans2 = 0
for i in range(len(s)):
    ans2 += int(s[i])

print(max(ans1, ans2))

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

m = str(int(s[0]) - 1) + (len(s) - 1) * "9" 
ans1 = 0
for i in range(len(m)):
    ans1 += int(m[i])

if s[-1] != "9":
    n1 = n - (int(s[-1]) + 1)
    s = str(n1)

ans2 = 0
for i in range(len(s)):
    ans2 += int(s[i])

print(max(ans1, ans2))

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

m = str(int(s[0]) - 1) + (len(s) - 1) * "9" 
ans1 = 0
for i in range(len(m)):
    ans1 += int(m[i])

if s[-1] != "9":
    n = n - (int(s[-1]) + 1)
    s = str(n)

ans2 = 0
for i in range(len(s)):
    ans2 += int(s[i])

print(max(ans1, ans2))

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

m = str(int(s[0]) - 1) + (len(s) - 1) * "9" 
ans1 = 0
for i in range(len(m)):
    ans1 += int(m[i])

if s[-1] != "9":
    n -= int(s[-1]) +1
    s = str(n)

ans2 = 0
for i in range(len(s)):
    ans2 += int(s[i])

print(max(ans1, ans2))

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

if s[-1] != "9":
    n1 = n - int(s[-1]) +1
    s1 = str(n1)

ans1 = 0
for i in range(len(s1)):
    ans1 += int(s[i])

m = str(int(s[0]) - 1) + (len(s) - 1) * "9" 
ans2 = 0
for i in range(len(m)):
    ans2 += int(m[i])

print(max(ans1, ans2))
Problem p03433 (python)

Fixed submission:
N = int(input())
A = int(input())

if N % 500 <= A:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
c1 = list(map(int, input().split()))
c2 = list(map(int, input().split()))
c3 = list(map(int, input().split()))

c = c1 + c2 + c3

if sum(c) % 3 == 0 and c[0] + c[4] + c[8] == c[1] + c[3] + c[8]:
    print("Yes")
else:
    print("No")
Problem p03523 (python)

Fixed submission:
s = list(input())
t = ["A", "K", "I", "H", "A", "B", "A", "R", "A"]


if s[-1] != "A":
    s = s + ["A"]
for i in range(len(t)):
    if len(s) <= i: break
    if t[i] != s[i] and t[i] != "A":
        break
    if t[i] != s[i] and t[i] == "A":
        s.insert(i, "A")

if s == t:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
s = list(input())
t = ["A", "K", "I", "H", "A", "B", "A", "R", "A"]


if s[-1] != "A":
    s = s + ["A"]
for i in range(len(t)):
    if t[i] != s[i] and t[i] != "A":
        break
    if t[i] != s[i] and t[i] == "A":
        s.insert(i, "A")

if s == t:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
s = list(input())
t = ["A", "K", "I", "H", "A", "B", "A", "R", "A"]

if s == t:
    print("YES")
    exit()

if len(s) >= len(t):
    print("NO")
    exit()
    
if s[-1] != "A":
    s = s + ["A"]
for i in range(len(t)):
    if t[i] != s[i] and t[i] == "A":
        s.insert(i, "A")
        print(s)
if s == t:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
s = list(input())
t = ["A", "K", "I", "H", "A", "B", "A", "R", "A"]

if s[-1] != "A":
    s = s + ["A"]
for i in range(len(t)):
    if t[i] != s[i] and t[i] == "A":
        s.insert(i, "A")

if s == t:
    print("YES")
else:
    print("NO")
Problem p03597 (python)

Fixed submission:
N = int(input())
A = int(input())

print(N ** 2 -A)

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

w = {0}
s = {0}

for i in range(f+1):
    for j in range(f+1):
        x = 100 * (a * i + b * j)
        if x <= f:
            w.add(x)

for i in range(f+1):
    for j in range(f+1):
        y = c * i + d * j
        if y <= f:
            s.add(y)

s_list = list(s)
s_list.sort()
w_list = list(w)
w_list.sort()


c_ans = 0
s_ans = 0
w_ans = 0

for i in range(1, len(w_list)):
    for j in range(1, len(s_list)):
        z = int(100 * s_list[j] / (s_list[j] + w_list[i]))
        sum = w_list[i] + s_list[j]
        if z <= int(100 * e / (e + 100)) and z > c_ans and sum <= f:
            c_ans = z
            w_ans = w_list[i]
            s_ans = s_list[j]

print(str(w_ans + s_ans) + " " + str(s_ans))
Problem p03651 (python)

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

a = [0] + a
a.sort()
if max(a) < k:
    print("IMPOSSIBLE")
    exit()

for i in range(len(a) - 1):
    if k == a[i]:
        print("POSSIBLE")
        break
    if a[i+1] - a[i] == 0: continue 
    if k % (a[i+1] - a[i]) == 0:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

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

a.sort()
if max(a) < k:
    print("IMPOSSIBLE")
    exit()

for i in range(n-1):
    if k == a[i]:
        print("POSSIBLE")
        break
    if k % (a[i+1] - a[i]) == 0:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")
Problem p03737 (python)

Fixed submission:
s = input().split()
a = ""

for i in range(len(s)):
    str = s[i][0]
    a += str.upper()

print(a)

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

even_is_negative = 0
odd_is_nagative = 0

for i in range(n):
    if i % 2 == 0 and a[i] < 0:
        even_is_negative += 1
    elif i % 2 == 1 and a[i] < 0:
        odd_is_nagative += 1

# print(even_is_negative)
# print(odd_is_nagative)

sum = a[0]
change = 0

if even_is_negative >= odd_is_nagative:
    for i in range(1, n):
        if i % 2 == 1 and sum + a[i] <= 0:
            change += abs(sum + a[i]) + 1
            sum = 1
            # print("a " + str(sum))
        elif i % 2 == 0 and sum + a[i] >= 0:
            change += sum + abs(a[i]) + 1
            sum = -1
            # print("b " + str(sum))
        else:
            sum += a[i]
            # print("c " + str(sum))

if even_is_negative < odd_is_nagative:
    for i in range(1, n):
        if i % 2 == 1 and sum + a[i] >= 0:
            change += sum + abs(a[i]) + 1
            sum = -1
            # print("a " + str(sum) + str(change))
        elif i % 2 == 0 and sum + a[i] <= 0:
            change += abs(sum + a[i]) + 1
            sum = 1
            # print("b " + str(sum)+ str(change))
        else:
            sum += a[i]
            # print("c " + str(sum)+ str(change))

if sum == 0:
    print(change + 1)
else:
    print(change)
Problem p03910 (python)

Fixed submission:
n = int(input())

a = []
m = 0
for i in range(n):
    if m >= n: break
    a.append(i+1)
    m += i+1
    
if m == n:
    print(*a)
else:
    a.remove(m-n)
    print(*a)

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

a = []
m = 0
for i in range(1, n):
    if m >= n: break
    a.append(i)
    m += i

if m == n:
    print(*a)
else:
    a.remove(m-n)
    print(*a)

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

a = []
m = 0
for i in range(1, n):
    if m >= n: break
    a.append(i)
    m += i

if m == n:
    print(*a)
else:
    a.pop(m-n)
    print(*a)

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

if n == 1 or n == 2:
    print(n)
else:
    a = []
    m = 0
    for i in range(1, n):
        if m > n: break
        a.append(i)
        m += i


    b = []
    for i in range(len(a) ** 2):
        g = []
        for j in range(len(a)):
            if ((i >> j) & 1):
                g.append(a[j])
        if sum(g) == n:
            b.append([g[-1], g])

    b.sort()
    for item in b[0][1]:
        print(item)
Problem p03937 (python)

Fixed submission:
h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]

dy = [0, 1]
dx = [1, 0]

stack = [[0 for _ in range(w)] for _ in range(h)]

def dfs(y, x):
    stack[y][x] = 1
    if x == w-1 and y == h-1:
        return
    for i in range(2):
        ny = y + dy[i]
        nx = x + dx[i] 
        if ny < 0 or ny >= h or nx < 0 or nx >= w:
            continue
        if a[ny][nx] == "#":
            dfs(ny, nx)
            break
    return

dfs(0, 0)
for i in range(h):
    for j in range(w):
        if a[i][j] == "#" and stack[i][j] == 0:
            print('Impossible')
            exit()
print('Possible')

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]

dy = [0, 1]
dx = [1, 0]

stack = [[0 for _ in range(w)] for _ in range(h)]

def dfs(y, x):
    stack[y][x] = 1
    if x == w-1 and y == h-1:
        return
    for i in range(2):
        ny = y + dy[i]
        nx = x + dx[i] 
        if ny < 0 or ny >= h or nx < 0 or nx >= w:
            continue
        if a[ny][nx] == "#":
            dfs(ny, nx)
            break
    return

dfs(0, 0)
for i in range(h):
    for j in range(w):
        if a[i][j] == "#" and stack[i][j] == 0:
            print('Impossible')
                exit()
    print('Possible')
Problem p02612 (python)

Fixed submission:
n = int(input())
for i in range(100):
    if i * 1000 >= n:
        print(i * 1000 - n)
        break

Buggy submission (verdict: Runtime Error):
n = int(input())
m = str(n)
if m[-1] == m[-2] == m[-3] == "0":
    print(0)
else:
    print(1000 - int(m[-3]+m[-2]+m[-1]))

Buggy submission (verdict: Runtime Error):
n = input()
m = str(n)
if m[-1] == m[-2] == m[-3] == "0":
    print(0)
else:
    print(1000 - int(m[-3]+m[-2]+m[-1]))
Problem p02630 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
q = int(input())
bc = [list(map(int, input().split())) for _ in range(q)]
s = 0
for g in range(len(a)):
    s += a[g]
e = [0] * 100001
for i in a:
    e[i] += 1
for j in range(q):
    s += (bc[j][1] - bc[j][0]) * e[bc[j][0]]
    e[bc[j][1]] += e[bc[j][0]]
    e[bc[j][0]] = 0
    print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
bc = [list(map(int, input().split())) for _ in range(q)]
s = 0
for g in range(len(a)):
    s += a[g]
e = [0] * 10001
for i in a:
    e[i] += 1
for j in range(q):
    s += (bc[j][1] - bc[j][0]) * e[bc[j][0]]
    e[bc[j][1]] += e[bc[j][0]]
    e[bc[j][0]] = 0
    print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 0
for g in range(len(a)):
    s += a[g]
e = [0] * 10001
for i in a:
    e[i] += 1
q = int(input())
bc = [list(map(int, input().split())) for _ in range(q)]
for j in range(q):
    s += (bc[j][1] - bc[j][0]) * e[bc[j][0]]
    e[bc[j][1]] += e[bc[j][0]]
    e[bc[j][0]] = 0
    print(s)
Problem p03544 (python)

Fixed submission:
n = int(input())
l = [2, 1]
for i in range(2, n+1):
    a = l[i-2] + l[i-1]
    l.append(a)
print(l[n])

Buggy submission (verdict: Runtime Error):
n = int(input())
l0 = 2
l1 = 1
for i in range(2, n+1):
    l = l0 + l1
    l0 = l1
    l1 = l
print(l)
Problem p03548 (python)

Fixed submission:
x, y, z = map(int, input().split())
print((x-z)//(y+z))

Buggy submission (verdict: Runtime Error):
x, y, z = map(int, input().split())
print((x-z)//(y+z)
Problem p03555 (python)

Fixed submission:
c1 = input()
c2 = input()
if (c1[0] == c2[2]) and (c1[1] == c2[1]) and (c1[2] == c2[0]):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    if (i+1)**2 > n:
        break
    elif (i+1)**2 <= n:
        ans = (i + 1)**2
print(ans)
Problem p03556 (python)

Fixed submission:
n = int(input())
for i in range(n):
    if (i+1)**2 > n:
        break
    elif (i+1)**2 <= n:
        ans = (i + 1)**2
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    if (i+1)**2 > n:
        break
    elif (i+1)**2 < n:
        ans = (i + 1)**2
print(ans)
Problem p03610 (python)

Fixed submission:
s = str(input())
a = ""
if len(s) % 2 == 0:
    for i in range(len(s)//2):
        a += s[2*i]
    print(a)
else:
    for i in range(len(s)//2+1):
        a += s[2*i]
    print(a)

Buggy submission (verdict: Runtime Error):
s = str(input())
a = ""
for i in range(len(s)//2+1):
    a += s[2*i]
print(a)
Problem p03624 (python)

Fixed submission:
s = str(input())
a = "abcdefghijklmnopqrstuvwxyz"
count = 0
n = 0
for i in range(len(a)):
    for j in range(len(s)):
        if a[i] == s[j]:
            count += 1
            break
    if count == 0:
        ans = a[i]
        print(ans)
        n = 1
        break
    else:
        count = 0
if n == 0:
    print("None")

Buggy submission (verdict: Runtime Error):
s = str(input())
a = "abcdefghijklmnopqrstuvwxyz"
count = 0
n = 0
for i in range(len(a)):
    for j in range(len(s)):
        if a[i] == s[j]:
            count += 1
            break
    if count == 0:
        ans = a[i]
        print(ans)
        n = 1
        break
    else:
        count = 0
if n = 1:
    print("None")

Buggy submission (verdict: Runtime Error):
s = str(input())
a = "abcdefghijklmnopqrstuvwxyz"
count = 0
for i in range(len(a)):
    for j in range(len(s)):
        if a[i] == s[j]:
            count += 1
    if count == 0:
        ans = a[i]
        break
    else:
        count = 0
print(ans)
Problem p03760 (python)

Fixed submission:
o = str(input())
e = str(input())
s = []
for i in range(len(e)):
    s.append(o[i])
    s.append(e[i])
if len(o) > len(e):
    s.append(o[-1])
print(*s, sep = "")

Buggy submission (verdict: Runtime Error):
o = str(input())
e = str(input())
s = []
for i in range(len(e)):
    s.append(o[i])
    s.append(e[i])
if len(o) - len(e) = 1:
    s.append(o[-1])
print(*s, sep = "")

Buggy submission (verdict: Runtime Error):
o = str(input())
e = str(input())
s = []
for i in range(len(o)):
    s.append(o[i])
    s.append(e[i])
print(*s, sep="")
Problem p02640 (python)

Fixed submission:
X,Y = map(int, input().split())
ans = "No"
foots = 2*X
for tsuru in range(X+1):
    if foots == Y:
        ans = "Yes"
    foots += 2
    
    
print(ans)

Buggy submission (verdict: Runtime Error):
ans = "No"
foots = 2*X
for tsuru in range(X+1):
    if foots == Y:
        ans = "Yes"
    foots += 2
    
    
print(ans)
Problem p02641 (python)

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

delta, notP = [], []
for i in range(0, 102):
    if not i in P:
        delta.append(abs(X-i))
        notP.append(i)

i = delta.index(min(delta))
print(notP[i])

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

min_abs = min([abs(X-i) for i in range(1, 100+1) if not i in P])

delta, notP = [], []
for i in range(1, 101):
    if not i in P:
        delta.append(abs(X-i))
        notP.append(i)

i = delta.index(min(delta))
print(notP[i])

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

min_abs = min([abs(X-i) for i in range(100+1) if not i in P])

delta, notP = [], []
for i in range(1, 101):
    if not i in P:
        delta.append(abs(X-i))
        notP.append(i)

i = delta.index(min(delta))
print(notP[i])
Problem p03471 (python)

Fixed submission:
# N = 2000
# Y = 20000000
N,Y = map(int, input().split())
ans= [-1, -1, -1]

for x in range(N+1):
    for y in range(N-x+1):
        price = x*10000 + y*5000 + int(N-x-y)*1000
#         print(x,y,N-x-y)
        if price == Y:
            ans = [x,y,N-x-y]
            break
            
    if price == Y: 
        break

print(ans[0], ans[1], ans[2])

Buggy submission (verdict: Runtime Error):
N,Y = map(int, input().split())
ans= [-1, -1, -1]

for x in range(N+1):
    for y in range(N-x+1):
        price = x*10000 + y*5000 + int(N-x-y)*1000
#         print(x,y,N-x-y)
        if price == Y:
        print(x,y,N-x-y)
        break
Problem p03472 (python)

Fixed submission:
import math


N,H = map(int, input().split())
A = []
B = []
for _ in range(N):
    a,b = map(int, input().split())
    A.append(a)
    B.append(b)

nage_count = 0
huri_count = 0
A_max = max(A)
for b in sorted(B, reverse = True):
  if b > A_max:
    nage_count += 1
    H -= b
    if H <= 0:
      break
  else: 
    break

# 今度は一番強いやつを振り続ける. 
if H>0:
  huri_count = math.ceil(H/A_max)
print(huri_count + nage_count)

Buggy submission (verdict: Runtime Error):
import math


N,H = map(int, input().split())
A = []
B = []
for _ in range(N):
    a,b = map(int, input().split())
    A.append(a)
    B.append(b)

nage_count = 0
for i in range(N):
  if B[i] > max(A):
    nage_count += 1
    H -= B[i]
  if H <= 0:
    break

# 今度は一番強いやつを振り続ける. 
if H>0:
  huri_count = math.ceil(H/max(A))
print(huri_count + nage_count)
Problem p03633 (python)

Fixed submission:
N = int(input())
T_arr = []
for _ in range(N):
    T_arr.append(int(input()))
    

import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


print(lcm_list(T_arr))

Buggy submission (verdict: Runtime Error):
N = int(input())
T_arr = []
for _ in range(N):
    T_arr.append(int(input()))
    




import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


print(lcm_list(T_arr))

Buggy submission (verdict: Runtime Error):
N = int(input())
T_arr = []
for _ in range(N):
    T_arr.append(int(input()))
    




import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


print(lcm_list(T_arr))
Problem p02797 (python)

Fixed submission:
n, k, s = map(int, input().split())
a = []
for _ in range(k):
        a.append(str(s))
for _ in range(n-k):
  if s != 1000000000:
  	a.append(str(s+1))
  else:
    a.append(str(s-1))
ans = ' '.join(a)
print(ans)

Buggy submission (verdict: Runtime Error):
n, k, s = map(int, input().split())
a = []
for _ in range(k):
        a.append(str(s))
for _ in range(n-k):
  if s != 1000000000
  	a.append(str(s+1))
  else:
    a.append(str(s-1))
ans = ' '.join(a)
print(ans)

Buggy submission (verdict: Runtime Error):
n, k, s = map(int, input().split())
a = []
for _ in range(k):
        a.append(str(s))
for _ in range(n-k):
  if s != 1000000000
        a.append(str(s+1))
  else:
    a.append(str(s-1))
ans = ' '.join(a)
print(ans)

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

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

a = []
if k == 0:
    for _ in range(n):
        a.append(str(s + 1000))
else:
    if n == k:
        for _ in range(n):
            a.append(str(s))
    else:
        if s != 1:
            for i in range(k + 1):
                if i % 2 == 0:
                    a.append(str(s - 1))
                else:
                    a.append(str(1))
            for _ in range(n - k - 1):
                a.append(str(s + 1))
        else:
            for _ in range(k):
                a.append(str(1))
            for _ in range(n - k):
                a.append(str(2))


ans = ' '.join(a)
print(ans)
Problem p02885 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a<=b*2:
    print(0)
else:
    print(a-b*2)a, b = map(int, input().split())

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a<=b*2:
    print(0)
else:
    print(a-b*2)a, b = map(int, input().split())
if a<=b*2:
    print(0)
else:
    print(a-b*2)
Problem p02917 (python)

Fixed submission:
n = int(input())
b = list(map(int, input().split()))
a = [b[0]]
for i in range(1,n-1):
    a.append(min(b[i], b[i-1]))
a.append(b[n-2])
print(sum(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
b = list(map(int, input().split()))
a = [b[0]]
for i in range(1,n-1):
    a.append(min(b[i], b[i-1]))
a.append(b[n-2])
print(sum(a)
Problem p02923 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
l = 0
j = 0
while j < n-1:
    count = 0
    i = j
    while h[i] >= h[i+1]:
        count+=1
        if i+1 == n-1:
            break
        i+=1
    if l < count:
        l =count
    j += count+1

print(l)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
l =[]
j = 0
while j < n-1:
    count = 0
    i = j
    while h[i] >= h[i+1]:
        count+=1
        if i+1 == n-1:
            break
        i+=1
    j += count+1
    l.append(count)
print(max(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
h.reverse()
l =[]
j = 0
while j < n-1:
    count = 0
    i = j
    while h[i] <= h[i+1]:
        count+=1
        if i+1 ==n-1:
            break
        i+=1
    j += count+1
    l.append(count)
print(max(l))

Buggy submission (verdict: Runtime Error):

n = int(input())
h = list(map(int, input().split()))
h.reverse()
l =[]
for i in range(n-1):
    count=0
    while h[i] <= h[i+1]:
        count+=1
        if i+1 ==n-1:
            break
        i+=1
    l.append(count)
print(max(l))
Problem p03280 (python)

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

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

Fixed submission:
r = int(input())
if r < 1200:
    print('ABC')
elif 1200 <= r < 2800:
    print('ARC')
else:
    print('AGC')

Buggy submission (verdict: Runtime Error):
r = input()
if r < 1200:
    print('ABC')
elif 1200 <= r < 2800:
    print('ARC')
else:
    print('AGC')
Problem p03378 (python)

Fixed submission:
n, m, x = map(int, input().split())
l = list(map(int, input().split()))
left = 0
right = 0
i = 0
while i < x:
    if i in l:
        left += 1
    i += 1
j = n-1
while j > x:
    if j in l:
        right += 1
    j -= 1

print(min(left, right))

Buggy submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
l = [int(input()) for _ in range(m)]
left = 0
right = 0
i = 0
while i < x:
    if i in l:
        left += 1
    i += 1
j = n-1
while j > x+1:
    if j in l:
        right += 1
    j -= 1

print(max(left, right))
Problem p03385 (python)

Fixed submission:
s = sorted(input())
if s[0] == 'a' and s[1] == 'b' and s[2] == 'c':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):

# 93
a, b, k = map(int, input().split())
l = list(range(a, b+1))
for i in l[:]:
    if a+k-1 < i < b-k+1:
        l.remove(i)

for i in l:
    print(i)

Buggy submission (verdict: Runtime Error):
s = input()
a = s.count('a')
b = s.count('b')
c = s.count('c')
if a*b*c == 1:
    print('Yse')
else;
    print('No')
Problem p03386 (python)

Fixed submission:
a, b, k = map(int, input().split())
la = list(range(a, a+k))
lb = list(range(b-k+1, b+1))
set = sorted(set(la+lb))

for i in set:
    if a <= i <= b:
        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 a+k-1 < i < b-k+1:
        l.remove(i)

for i in l:
    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 a+k-1 < i < b-k+1:
        l.remove(i)

for i in range(len(l)):
    print(l[i])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
l = list(range(a, b+1))
for i in l[:]:
    if a+k-1 < i < b-k+1:
        l.remove(i)

for i in range(len(l)):
    print(l[i])
Problem p03399 (python)

Fixed submission:
a, b, c, d = [int(input()) for _ in range(4)]

print(min(a, b) + min(c, d))

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

ab = [a, b]
cd = [c, d]

print(min(ab) + min(cd))