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

Fixed submission:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    K = list(map(int, lines.pop(0).split(' ')))
    N = int(lines.pop(0))
    K.sort()
    a = K.pop(-1)
    print(a * 2**N + sum(K))


#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]
#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B = map(int, lines.pop(0).split(' '))
    if A <= B:
        print(A)
    else:
        print(A-1)
#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]
#
 # solve !!
#
solve(lines)
Problem p03361 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    def solve_iter(hi, wi):
        vec = [(0,1),(0,-1),(1,0),(-1,0)]
        for v in vec:
            hn = hi + v[0]
            wn = wi + v[1]
            if hn >= 0 and hn < H and wn >= 0 and wn < W:
                if NLIST[hn][wn] == '#' or NLIST[hn][wn] == '*':
                    NLIST[hi][wi] = '*'
                    NLIST[hn][wn] = '*'
                    #solve_iter(hn, wn)
        return

    H,W = map(int, lines.pop(0).split(' '))
    NLIST = []
    for i in range(H):
        NLIST.append(list(lines.pop(0)) )

    res = 'Yes'
    for i in range(H):
        for j in range(W):
            if NLIST[i][j] == '#':
                solve_iter(i, j)
            if NLIST[i][j] == '#':
                res = 'No'

    print(res)

#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    def solve_iter(hi, wi):
        vec = [(0,1),(0,-1),(1,0),(-1,0)]
        for v in vec:
            hn = hi + v[0]
            wn = wi + v[1]
            if hn >= 0 and hn < H and wn >= 0 and wn < W:
                if NLIST[hn][wn] == '#':
                    NLIST[hi][wi] = '.'
                    NLIST[hn][wn] = '.'
                    solve_iter(hn, wn)
        return

    H,W = map(int, lines.pop(0).split(' '))
    NLIST = []
    for i in range(H):
        NLIST.append(list(lines.pop(0)) )

    res = 'Yes'
    for i in range(H):
        for j in range(W):
            if NLIST[i][j] == '#':
                solve_iter(i, j)
            if NLIST[i][j] == '#':
                res = 'No'

    print(res)

#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
Problem p03385 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    S = list(lines.pop(0))
    S.sort()
    S = ''.join(S)
    if S == 'abc':
        print('Yes')
    else:
        print('No')

#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    S = list(lines.pop(0))
    S.sort()
    S = ''.join(S)
    if S == 'abc':
        print('Yes')
    else:
        print('No')

#
# main
#
lines = contents.split('\n')

# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
Problem p03386 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B,K = map(int, lines.pop(0).split(' '))
    NLIST = set()
    for i in range(K):
        if A+i <= B:
            NLIST.add(A+i)
        if A <= B-i:
            NLIST.add(B-i)

    NLIST = list(NLIST)
    NLIST.sort()
    for i in NLIST:
        print(i)

#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B,K = map(int, lines.pop(0).split(' '))
    NLIST = list(range(A,B+1))
    res = list(set(NLIST[:K] +  NLIST[-K:]))
    res.sort()
    for i in res:
        print(i)

#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B,K = map(int, lines.pop(0).split(' '))
    NLIST = list(range(A,B+1))
    res = list(set(NLIST[:K] +  NLIST[-K:]))
    for i in res:
        print(i)

#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
Problem p02817 (python)

Fixed submission:
S,T = input().split()
print(T+S)

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

Q = K - A
q = A - K
if Q < 0 :
  print (q)
if Q >= 0 :
  W = B - Q
  if W >= 0:
    print ("0",W)
  if W< 0 :
    print("0 0")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
print(T + S)
Problem p02952 (python)

Fixed submission:
N = int (input())
if N < 10:
  print (N)
elif N >=10 and N <100:
  print ("9")
elif N >=100 and N < 1000:
  print (N - 99 + 9)
elif N >= 1000 and N < 10000:
  print ("909")
elif N >=10000 and N < 100000:
  print (N - 9999 + 900 + 9)
elif N == 100000:
  print ("90909")

Buggy submission (verdict: Runtime Error):
N = int (input())
if N < 10:
  print (N)
if N >=10 && N <100:
  print ("9")
if N >=100 && N < 1000:
  print (N - 99 + 9)
if N >= 1000 && N < 10000:
  print ("909")
if N >=10000 && N < 100000:
  print (N - 9999 + 900 + 9)
if N == 100000:
  print ("90909")
Problem p03455 (python)

Fixed submission:
a,b = map(int, input().split())
ama1 = a % 2 
ama2 = b % 2

if ama1 == 1 and ama2 == 1 :
    print ("Odd")
else :
    print ("Even")

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

if ana1 == 1 and ama2 == 1 :
    print ("Odd")
else :
    print ("Even")

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

if ana1 == 1 and ama2 == 1 :
    print　("Odd")
else :
    print ("Even")
Problem p03493 (python)

Fixed submission:
S = input()
N = S.count("1")
print (N)

Buggy submission (verdict: Runtime Error):
S = int(input())
N = S.count("1")
print (N)
Problem p02767 (python)

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

def num(P, X):
    number = 0
    for x in X:
        num = x-P
        #print(str(num))
        num2 = num**2
        number += num2
    return number

nList = []
for p in range(min(X), max(X) + 1):
    nList.append(num(p, X))

n = str(min(nList))
print(n)

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


def num(N,X):
    number = 0
    for x in X:
        num = x-N

        num2 = num**2

        number += num2

    return number
    
kekka = str(num(N,X))
print(kekka)
Problem p02994 (python)

Fixed submission:
n, l = map(int, input().split())
if l <= 0 and abs(l) < n:
    a = int((n * (2 * l + n - 1)) / 2)
    print(a)
elif l <= 0 and abs(l) >= n:
    a = int((n - 1) * (2 * l + n - 2) / 2)
    print(a)
else:
    a = int((n - 1) * (2 * l + n) / 2)
    print(a)

Buggy submission (verdict: Runtime Error):
n, l = map(int, input(),split())
if l > 0:
    print((n - 1) * (int(n / 2) + l - 1))
else:
    print((n - 1) * (int(n / 2) + l))
Problem p03085 (python)

Fixed submission:
b = input()
 
if b == "A":
  print("T")
if b == "T":
  print("A")
if b == "C":
  print("G")
if b == "G":
  print("C")

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

if b == A:
  print("T")
if b == T:
  print("A")
if b == C:
  print("G")
if b == G:
  print("C")

Buggy submission (verdict: Runtime Error):
b = input()
 
if b == A:
  print("T")
if b == T:
  print("A")
if b == C:
  print("G")
if b == G:
  print("C")

Buggy submission (verdict: Runtime Error):
b = input()
 
if b == A:
  print("T")
elif b == T:
  print("A")
elif b == C:
  print("G")
elif b == G:
  print("C")

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

if b == A:
  print("T")
elif b == T:
  print("A")
elif b == C:
  print("G")
elif b == G:
  print("C")
Problem p03105 (python)

Fixed submission:
A, B, C = map(int, input().split())
cnt = 0
 
while A <= B:
  B = B - A
  
  if cnt >= C:
    break
  cnt+=1
print(cnt)

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

while A <= B:
  B = B - A
  
  if cnt >= C
    break
  cnt+=1
print(cnt)
Problem p03238 (python)

Fixed submission:
N = int(input())

if N == 1:
    print("Hello World")
elif N == 2:
    A = int(input())
    B = int(input())
    print(A + B)

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

if N == 1:
    print("Hello World")
elif N == 2:
    A, B = map(int, input().split())

    print(A + B)
Problem p03292 (python)

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

a.sort()

print(a[2]-a[0])

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

if abs(a - b) < abs(a - c) and abs(a - b) < abs(b - c):
    print(abs(a - b) + abs(b - c))
elif abs(a - c) < abs(a - b) and abs(a - c) < abs(b - c):
    print(abs(a - c) + abs(c - b)
elif abs(b - c) < abs(a - b) and abs(b - c) < abs(a - c):
    print(abs(b - c) + abs(c - a))

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

if abs(a - b) < abs(a - c) and abs(a - b) < abs(b - c):
    print(abs(a - b) + abs(b - c))
elif abs(a - c) < abs(a - b) and abs(a - c) < abs(b - c):
    print(abs(a - b) + abs(b - c)
else:
    print(abs(b - c) + abs(c - a))

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

if abs(a - b) < abs(a - c) and abs(a - b) < abs(b - c):
    print(abs(a - b) + abs(b - c))
elif abs(a - c) < abs(a - b) and abs(a - c) < abs(b - c):
    print(abs(a - c) + abs(b - c)
else:
    print(abs(a - c) + abs(a - b))

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

if abs(a - b) < abs(a - c) and abs(a - b) < abs(b - c):
    print(abs(a - b) + abs(b - c))
elif abs(a - c) < abs(a - b) and abs(a - c) < abs(b - c)
    print(abs(a - c) + abs(b - c)
else:
    print(abs(a - c) + abs(a - b))
Problem p03337 (python)

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

add = A + B
sub = A - B
mul = A * B

if add > sub and add > mul:
    print(add)
elif sub > add and sub > mul:
    print(sub)
elif mul > add and mul > sub:
    print(mul)
else:
    print(add)

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

if B < 0:
    print(A - B)
elif A > 1 and B > 1:
    print(A * B)
else A ==1 or B == 1:
    print(A + B)

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

if A < 0 or b < 0:
    print(abs(A) + abs(B))
else:
    print(A * B)
Problem p03351 (python)

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

if abs(a - c) <= d:
    print("Yes")
elif abs(a - b) <= d and abs(b - c) <= d:
    print("Yes")
else:
    print("No")

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

if abs(a - c) <= d:
    print("Yes")
elif abs(a - b) <= d and abs(b + )c <= d:
    print("Yes")
else:
    print("No")
Problem p03385 (python)

Fixed submission:
a = list(input())
if a[0] == a[1] or a[1] == a[2] or a[2] == a[0]:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
a = list(input())
if i[0] == i[1] and i[1] == i[2] and i[2] == i[0]:
    print("Yes")
else:
    print("No")

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

for i in a:
    if i == "a":
        c1 = 1
    elif i == "b":
        c2 = 1
    elif i == "c":
        c3 = 1
if c1 == 1 and c2 == 1 and c3 == 1:
    print("Yes")
else:
    print("No")

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

for i in a:
    if i == "a":
        c1 = 1
    elif i == "b":
        c2 = 1
    elif i == "c":
        c3 = 1

if c1 == 1 and c2 == 1 and c3 == 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = list(input().split(''))

for i in a:
    if i == "a":
        c1 = 1
    elif i == "b":
        c2 = 1
    elif i == "c":
        c3 = 1

if c1 == 1 and c2 == 1 and c3 == 1:
    print("Yes")
else:
    print("No")
Problem p03415 (python)

Fixed submission:
A, B, C = [input() for i in range(3)]

print(A[0] + B[1] + C[2])

Buggy submission (verdict: Runtime Error):
#include <stdio.h>

int main(void){
  int l1 = [3];
  int i;
  
  for (i = 0;i < 9;i += 3){
    scanf("%d", &l1[i]);
  }
  print("%d%d%d\n", l1[0], l1[1], l1[2]);
  return 0;
}

Buggy submission (verdict: Runtime Error):
a = [input()for i in range(3)]
b = [input()for i in range(3)]
c = [input()for i in range(3)]

print(a[0] + b[1] + c[2])
Problem p03469 (python)

Fixed submission:
y, m, d = input().split('/')

print("2018/01/", end='')
print(d)

Buggy submission (verdict: Runtime Error):
y, m, d = map(int, input().split('/'))

print(y+1 + "/" + m + "/" + d)
Problem p03473 (python)

Fixed submission:
h = int(input())

print(24 + (24 - h))

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

print(24 + (24 - h)
Problem p02814 (python)

Fixed submission:
from sys import stdin
import numpy as np
from fractions import gcd


# noinspection PyShadowingBuiltinsInspection

def lcm(x, y):
    return (x * y) // gcd(x, y)

def main():
    N, M = [int(x) for x in input().split()]
    a = sorted(list({int(x) for x in input().split()}), reverse=True)
    x = a[0]
    p2 = 1
    while x % 2 == 0:
        p2 *= 2
        x //= 2
    flag = False
    y = 1 # a//2 の最小公倍数
    for i in range(len(a)):
        if a[i] % p2 != 0 or (a[i] // p2) % 2 == 0:
            flag = True
            break
        a[i] //= 2
        y = lcm(a[i], y)
    if flag:
        return 0
    z = M // y
    return z // 2 if z % 2 == 0 else z // 2 + 1
    # b = [a[0]]
    # for i in range(1, len(a)):
    #     flag = False
    #     for x in b:
    #         if x % a[i] == 0:
    #             flag = True
    #             break
    #     if not flag:
    #         b.append(a[i])
    # # print(b)
    # y = 1
    # for x in b:
    #     # print(b)
    #     y *= x
    # z = M // y
    # # print(y, z*y)
    # ret = z // 2 if z % 2 == 0 else z // 2 + 1
    # # print(ret)
    #
    # return ret


if __name__ == "__main__":
    print(main())

Buggy submission (verdict: Runtime Error):
from sys import stdin
import numpy as np
from math import gcd


# noinspection PyShadowingBuiltinsInspection

def lcm(x, y):
    return (x * y) // gcd(x, y)

def main():
    N, M = [int(x) for x in input().split()]
    a = sorted(list({int(x) for x in input().split()}), reverse=True)
    x = a[0]
    p2 = 1
    while x % 2 == 0:
        p2 *= 2
        x //= 2
    flag = False
    y = 1 # a//2 の最小公倍数
    for i in range(len(a)):
        if a[i] % p2 != 0 or (a[i] // p2) % 2 == 0:
            flag = True
            break
        a[i] //= 2
        y = lcm(a[i], y)
    if flag:
        return 0
    z = M // y
    return z // 2 if z % 2 == 0 else z // 2 + 1
    # b = [a[0]]
    # for i in range(1, len(a)):
    #     flag = False
    #     for x in b:
    #         if x % a[i] == 0:
    #             flag = True
    #             break
    #     if not flag:
    #         b.append(a[i])
    # # print(b)
    # y = 1
    # for x in b:
    #     # print(b)
    #     y *= x
    # z = M // y
    # # print(y, z*y)
    # ret = z // 2 if z % 2 == 0 else z // 2 + 1
    # # print(ret)
    #
    # return ret


if __name__ == "__main__":
    print(main())
Problem p02885 (python)

Fixed submission:
a,b = [int(x) for x in input().split()]
c = a - 2*b
if c < 0:
  c = 0
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
ds = [int(x) for x in input().split()]
ds2 = [x*x for x in ds]
s = 0
s2 = 0
for i in range(n):
  s += ds[i]
  s2 += ds2[i]
ss = 0
for i in range(n):
  ss += ds[i] * s

print((ss - s2) / 2 )

Buggy submission (verdict: Runtime Error):
#import numpy as np
n = int(input())
#ds = np.array([int(x) for x in input().split()])
ds = [int(x) for x in input().split()]
ds2 = [x*x for x in ds]
s = sum(ds)
#print((sum(ds * sum(ds)) - sum(ds ** 2)) / 2 )
print(int((sum(ds * s) - sum(ds2)) / 2 ))
Problem p02886 (python)

Fixed submission:
n = int(input())
ds = [int(x) for x in input().split()]
ret = 0
for i in range(n - 1):
  for j in range(i+1, n):
    ret += ds[i] * ds[j]
print(ret)

Buggy submission (verdict: Runtime Error):
n = int(input())
ds = map(int, input.split())
ret = 0
for i in range(n):
  for j in range(n-1):
    ret += ds[i] * ds[j + 1]
print(ret)
Problem p02899 (python)

Fixed submission:
from sys import stdin
import numpy as np


# noinspection PyShadowingBuiltinsInspection

def main():
    n = int(input())
    students = [int(x) for x in input().split()]
    ret = [0] * n
    for i in range(n):
        ret[students[i] - 1] = i + 1
    print(" ".join([str(x) for x in ret]))
    return


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
N = int(input())
nu = [int(x) for x in input().split()]
r2 = {}

for i in nu:
  r2[i] = nu.index(i)
#print(r2)

j2 = []
for i in range(len(r2)):
  j2.append(r2[i+1]+1)
#print(j2)

print(" ".join(j2))
Problem p02910 (python)

Fixed submission:
s = input()
i = 0
flag = True
for c in s:
  i += 1
  if (i % 2 == 0 and c == "R") or (i % 2 == 1 and c == "L"):
    print("No")
    exit(0)
print("Yes")

Buggy submission (verdict: Runtime Error):
s = input()
i = 1
flag = True
c in s:
  if (i % 2 == 0 and c == "L") or (i % 2 == 1 and c == "R"):
    print("No")
    exit
print("Yes")
Problem p02939 (python)

Fixed submission:
def main():
    s = input()
    N = len(s)
    ans = 0

    tmp = ""
    i = 0
    while i < N:
        if not tmp == s[i]:
            tmp = s[i]
            ans += 1
        else:
            tmp = ""
            i += 1
            if not i == N:
                 ans += 1
        i += 1
        # print(tmp, ans, i)

    print(ans)
    return


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
s = input()
  N = len(s)
  ans = 0

  tmp = ""
  i = 0
  while i < N:
if not tmp == s[i]:
tmp = s[i]
            ans += 1
  else:
tmp = ""
  i += 1
  if not i == N:
ans += 1
  i += 1
  # print(tmp, ans, i)

  print(ans)
Problem p03370 (python)

Fixed submission:
n, x = input().split()
n = int(n)
x = int(x)
m = []
m_min = 1000
gokei = 0
for i in range(n):
  m.append(int(input()))
  gokei += m[i]
  if m_min > m[i]:
    m_min = m[i]
x -= gokei
print((x//m_min) + n)

Buggy submission (verdict: Runtime Error):
n, x = input().split()
n = int(n)
x = int(x)
m = []
m_min = 1000
gokei = 0
for i in range(n):
  m.append(int(intput()))
  gokei += m[i]
  if m_min > m[i]:
    m_min = m[i]
x -= gokei
print((x//m_min) + n)
Problem p03583 (python)

Fixed submission:
from sys import stdin

gets = stdin.readline


def main():
    n = int(gets())
    h, w = 0, 0
    flag = False
    for _ in range(3500):
        h += 1
        w = 0
        for _ in range(3500):
            w += 1
            y = (4 * h * w - n * (h + w))
            if y > 0:
                modulo = n % y * h % y * w % y
                if modulo % y == 0:
                    print(h, w, (n*h*w)//y)
                    flag = True
                    break
        if flag:
            break
    return


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from sys import stdin

gets = stdin.readline

@profile
def main():
    n = int(gets())
    flag = False
    for h in range(3500, 1, -1):
        nh = n*h
        for w in range(1, h+1):
            y = (4 * h * w - nh - n*w)
            if y > 0 and (nh % y == 0 or w % y == 0):
                print(h, w, (nh*w)//y)
                flag = True
                break
        if flag:
            break
    return


if __name__ == "__main__":
    main()
Problem p03587 (python)

Fixed submission:
def main():
    s = input()
    cnt = 0
    for c in s:
        if c == '1':
            cnt += 1
    print(cnt)
    return


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    max_a, max_b = 0, 0 # type:int
    for _ in range(n):
        a, b = input().split(' ')
        a = int(a)
        if max_a < a:
            max_a = a
            max_b = int(b)
    print(max_a + max_b)


if __name__ == "__main__":
    main()
Problem p03588 (python)

Fixed submission:
def main():
    n = int(input())
    ab = [] # type:[[int]] 
    for i in range(n):
        ab.append([int(x) for x in input().split()])
    a, b = max(ab, key=lambda x: x[0])
    print(a + b)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    ab:[[int]] = []
    for i in range(n):
        ab.append([int(x) for x in input().split()])
    a, b = max(ab, key=lambda x: x[0])
    print(a + b)


if __name__ == "__main__":
    main()
Problem p03701 (python)

Fixed submission:
n = int(input())
s = []
all_ac = 0
for i in range(n):
    s.append(int(input()))
    all_ac += s[-1]
s.sort()
if((all_ac % 10) == 0):
    for x in s:
        if(x % 10 != 0):
            all_ac -= x
            break
if((all_ac % 10) == 0):
    print(0)
else:
    print(all_ac)

Buggy submission (verdict: Runtime Error):
n, a, b = [int(i) for i in input().split()]
hs = [None]*n
kill_b = [None]*n
all_hp = 0
all_killb = 0
for i in range(n):
    hs[i] = int(input())
    # all_hp += hs[i]
    # kill_b[i] = hs[i] // b
    # if((hs[i] % b) != 0):
    #     kill_b[i] += 1
    # all_killb += kill_b[i]
# hs.sort()
max_hp = max(hs)
ret = 0
ab = a - b
right = max_hp // b
if((max_hp % b) != 0):
    right += 1
left = 1
while right != left:
    middle = (right + left) // 2
    # print([left, right, middle])
    all_a = 0
    for x in hs:
        nokori = x - (b * middle)
        if(nokori > 0):
            num_a = nokori // ab
            if(x > num_a * a + (middle - num_a) * b):
                num_a += 1
            all_a += num_a
    if(all_a <= middle):
        right = middle
    else:
        left = middle + 1
ret = right
    # for i in range(hs[-1] // b):
        # flag = False
        # for j in range(n):
        #     ret += 1
        #     base_height = (ret * b) + (i * (a-b))
        #     #print(base_height)
        #     if((j == n-1) or (hs[-(j+2)] <= (base_height))):
        #         break
        # max_height = (ret * b) + ((i + 1) * (a-b))
        # if(max_height >= hs[-1]):
        #     break
print(ret)
Problem p03730 (python)

Fixed submission:
a,b,c = [int(i) for i in input().split()]
arr = set()
ret = "NO"
r = a%b
if r==0:
    if c==0:
        ret="YES"
    else:
        pass
elif r==1:
    ret = "YES"
else:
    rr = r
    while not(rr in arr):
        # print(arr,rr)
        if rr <= c and (c-rr)%r == 0:
            ret = "YES"
            break
        else:
            arr.add(rr)
            n = int((b-rr)/r)
            n += 1 if (b-rr)%r != 0 else 0
            rr = (n*r + rr)%b
            # print(n,rr)
print(ret)

Buggy submission (verdict: Runtime Error):
a,b,c = [int(i) for i in input().split()]
arr = set()
ret = "NO"
r = a%b
if r==0:
    if c==0:
        ret="YES"
    else:
        pass
elif r==1:
    ret = "YES"
else:
    rr = r
    while not(rr in arr):
#        print(arr,rr)
        if rr <= c and (c-rr)%r == 0:
            ret = "YES"
            break
        else:
            arr.add(rr)
            n = int(b-rr)/r
            n += 1 if (b-rr)%r != 0
            rr = (n*r + rr)%b
print(ret)
Problem p03760 (python)

Fixed submission:
o = input()
e = input()
ret = ""
for i in range(len(o) + len(e)):
    if i % 2 == 0:
        ret += o[i//2]
    else:
        ret += e[i//2]
print(ret)

Buggy submission (verdict: Runtime Error):
o = input()
e = input()
ret = ""
for i in range(len(o) + len(e)):
    if i % 2 == 0:
        ret += o[i/2]
    else:
        ret += e[i/2]
print(ret)