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

Fixed submission:
# 累積和の手法をとる
# 簡単にいうと要素が ある区間の和 であるようなリストを先に作成しておき
# 必要な時に取り出すという手法である
# 同じ計算過程を何回も繰り返す（上の解法）ことなく結果がでる
N = int(input())
S = input()
w = [0 for _ in range(N)]       # Wを向いている人の番号に１、逆の方角の人に０を割り当てる
sw = [0 for _ in range(N+1)]    # リストwの累積和のリスト、つまり sw[i] は 0~i-1 でWを向いている人の累積和
e = [0 for _ in range(N)]       # Eを向いている人の番号に１、逆の方角の人に０を割り当てる
se = [0 for _ in range(N+1)]    # リストeの累積和のリスト
l = []

for i in range(N):
    if S[i] == "W":
        w[i] = 1
    else:
        e[i] = 1

# 累積和を格納したリストを求める
for i in range(N):
    sw[i+1] = sw[i] + w[i]
    se[i+1] = se[i] + e[i]

# 本計算
for i in range(N):      # i 番目がリーダーだとする
    counter = sw[i] + (se[N] - se[i+1])
    l.append(counter)

print(min(l))

Buggy submission (verdict: Runtime Error):
# 累積和の手法をとる
# 簡単にいうと要素が ある区間の和 であるようなリストを先に作成しておき
# 必要な時に取り出すという手法である
# 同じ計算過程を何回も繰り返す（上の解法）ことなく結果がでる
N = int(input())
S = input()
w = [0 for _ in range(N)]       # Wを向いている人の番号に１、逆の方角の人に０を割り当てる
sw = [0 for _ in range(N+1)]    # リストwの累積和のリスト、つまり sw[i] は 0~i-1 でWを向いている人の累積和
e = [0 for _ in range(N)]       # Eを向いている人の番号に１、逆の方角の人に０を割り当てる
se = [0 for _ in range(N+1)]    # リストeの累積和のリスト
l = []

for i in range(N):
    if S[i] == "W":
        w[i] = 1
    else:
        e[i] = 1

# 累積和を格納したリストを求める
for i in range(N):
    sw[i+1] = sw[i] + w[i]
    se[i+1] = se[i] + e[i]

# 本計算
for i in range(N):      # i 番目がリーダーだとする
    counter = sw[i] + (se[N+1] - se[i+1])
    l.append(counter)

print(min(l))

Buggy submission (verdict: Runtime Error):
# 累積和の手法をとる
# 簡単にいうと要素が ある区間の和 であるようなリストを先に作成しておき
# 必要な時に取り出すという手法である
# 同じ計算過程を何回も繰り返す（上の解法）ことなく結果がでる
N = int(input())
S = input()
w = [0 for _ in range(N)]       # Wを向いている人の番号に１、逆の方角の人に０を割り当てる
sw = [0 for _ in range(N)]      # リストwの累積和のリスト
e = [0 for _ in range(N)]       # Eを向いている人の番号に１、逆の方角の人に０を割り当てる
se = [0 for _ in range(N)]      # リストeの累積和のリスト
l = []

for i in range(N):
    if S[i] == "W":
        w[i] = 1
    else:
        e[i] = 1

# 累積和を格納したリストを求める
for i in range(N-1):
    sw[i+1] = sw[i] + w[i]
    se[i+1] = se[i] + e[i]

# 本計算
for i in range(N):
    if i != 0:
        counter = sw[i-1] + (se[N] - se[i])
    else:
        counter = se[N] - se[i]
    l.append(counter)

print(min(l))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
l = []
for i in range(N):  # iはリーダーのインデックス番号
    counter = 0     # counterは向きを変える人数
    for j in range(i):
        if S[j] == "W":
            counter += 1
    for j in range(j+1,N):
        if S[j] == "E":
            counter += 1
    l.append(counter)
print(min(l))

Buggy submission (verdict: Runtime Error):
N = int(input())
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A = [A1,A2]
# ここまでが入力

l = []
# 経路の選び方は i に関して
# i回右に進む
# 1回下に進む
# N-i-1回右に進む
# つまり、上の行の[0]~[i]までを加算
# 下の行の[i]~[N]を加算すればいいだけである
for i in range(N):
    counter = 0
    for j in range(i+1):
        counter += A1[j]
    for j in range(i, N):
        counter += A2[j]
    l.append(counter)

print(max(l))
Problem p03494 (python)

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

# xが２で何回割れるかの関数
def how_much_time_divisible(x):
    ans = 0
    
    while x % 2 == 0:
        x /= 2
        ans += 1
    return ans

# リストaの要素すべてに対して、2で何回割れるかの値に置き換えたい（ｂがその置き換わったリストである）
b = map(how_much_time_divisible, a)
# bの要素で最も小さいものが答えである
print(min(b))

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

# xが２で何回割れるかの関数
def how_much_time_divisible(x):
    ans = 0　
    while x % 2 == 0:
        x /= 2
        ans += 1
    return ans

# リストaの要素すべてに対して、2で何回割れるかの値に置き換えたい（ｂがその置き換わったリストである）
b = map(how_much_time_divisible, a)
# bの要素で最も小さいものが答えである
print(min(b))
Problem p03861 (python)

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

def f(n):
    if n == -1:
        return 0
    return n // x + 1

print(f(b)-f(a-1))

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

def f(n):
    if n = -1:
        return 0
    return n // x

print(f(b)-f(a-1))
Problem p03796 (python)

Fixed submission:
import math
n = int(input())

print(math.factorial(n) % (10**9+7))

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

print(math.factorial(n) % (10**9+7)

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

p=1
for i in range(1, n+1):
    p = i*(p % (10**9 + 7)) 

print(p

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

p=1
for i in range(1, n+1):
    p = p*i  

print(p % (10**9 + 7)

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

p=1
for i in range(1, n+1):
    p = p*i  

print(p % (10**9 + 7)
Problem p03455 (python)

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

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

Fixed submission:
N = int(input())
routes = [(0,0,0)]
append = routes.append
for _ in range(0, N):
    t, x, y = map(int, input().split())
    append((t, x, y))
for i in range(1, N+1):
    bt, bx, by = routes[i-1]
    t, x, y = routes[i]
    ct = t - bt
    # xだけで考える。yとxは独立させて考えて問題ない。両方が成立しなければ成立しないため。
    cx = abs(x - bx)
    cy = abs(y - by)
    if cx > ct or cy > ct:
        print ("No")
        exit()
    if (cx+cy) % 2 != ct % 2:
        print ("No")
        exit()
print ("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
routes = [(0,0,0)]
append = routes.append
for _ in range(0, N):
    t, x, y = map(int, input().split())
    append((t, x, y))
for i in range(1, N+2):
    bt, bx, by = routes[i-1]
    t, x, y = routes[i]
    ct = t - bt
    # xだけで考える。yとxは独立させて考えて問題ない。両方が成立しなければ成立しないため。
    cx = x - bx
    cy = y - by
    if cx > ct or cy > ct:
        print ("No")
        exit()
    if (cx+cy) % 2 != ct % 2:
        print ("No")
        exit()
print ("Yes")
Problem p03471 (python)

Fixed submission:
N, Y = map(int, input().split())
result = [-1, -1, -1]
for a in range(0, N+1):
    for b in range(0, N+1):
        c = N-a-b
        if c < 0:
            continue
        if Y == (10000*a + 5000*b + 1000*c):
            result[0] = a
            result[1] = b
            result[2] = c
print (" ".join(map(str, result)))

Buggy submission (verdict: Runtime Error):
import sys
N, Y = map(int, input().split())
for a in range(N+1):
    for b in range(N+1):
        c = N - a - b
        if c < 0:
            continue
        if (10000*a + 5000*b + 1000*c) == Y:
            print(str(a)+" "+str(b)+" "+sstr(c))
            sys.exit()
print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
import sys
N, Y = map(int, input().split())
for a in range(N+1):
    for b in range(N+1):
        c = N - a - c
        if c < 0:
            continue
        if 10000*a + 5000*b + 1000*c == Y:
            print(str(a)+" "+str(b)+" "+sstr(c))
            sys.exit()
print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().split())
result = [-1, -1, -1]
for a in range(0, N):
    for b in range(0, N):
        c = N-(a+b)
        if 10000*a + 5000*b + 1000*c:
            result[0] = a
            result[1] = b
            result[2] = c
print (" ".join(result))
Problem p03478 (python)

Fixed submission:
N, A, B = map(int, input().split())
total = 0
for n in range(1, N+1):
    tmp = n
    t = 0
    while n > 0:
        t += n%10
        n = n // 10
    if A <= t and t <= B:
        total += tmp
print (total)

Buggy submission (verdict: Runtime Error):
total = 0
for i in range(0, N):
    t = sum(map(int, list(str(i))))
    if A <= t <= B:
        total += t
print (total)
Problem p03494 (python)

Fixed submission:
N = int(input())
vals = list(map(int, input().split()))
count = 0
is_odd = False
while True:
    for i in range(0, N):
        if vals[i] % 2 == 1:
            is_odd = True
        vals[i] /= 2
    if is_odd:
        break
    count += 1
print (count)

Buggy submission (verdict: Runtime Error):
N = int(input())
vals = map(int, input().split())
result = 1000000
for i in range(0, N):
    val = vals[i]
    count = 0
    while True:
        if val % 2 == 1:
            break
        val /= 2
        count += 1
    if result > count:
        result = count
print (result)

Buggy submission (verdict: Runtime Error):
N = input()
vals = map(int, input().split())
result = 1000000
for i in range(0, N):
    val = vals[i]
    count = 0
    while True:
        if val % 2 == 1:
            break
        val /= 2
        count += 1
    if result > count:
        result = count
print (result)

Buggy submission (verdict: Runtime Error):
N = input()
vals = map(int, input().split())
result = 1000000
for i in range(N):
    val = vals[i]
    count = 0
    while True:
        if val % 2 == 1:
            break
        val /= 2
        count += 1
    if result > count:
        result = count
print (result)

Buggy submission (verdict: Runtime Error):
N = input()
vals = map(int, input().split())
result = 1000000
for i in xrange(N):
    val = vals[i]
    count = 0
    while True:
        if val % 2 == 1:
            break
        val /= 2
        count += 1
    if result > count:
        result = count
print (result)

Buggy submission (verdict: Runtime Error):
import sys
N = input()
vals = map(int, input().split())
result = sys.maxint
for i in xrange(N):
    val = vals[i]
    count = 0
    while True:
        if val % 2 == 1:
            break
        val /= 2
        count += 1
    if result > count:
        result = count
print (result)

Buggy submission (verdict: Runtime Error):
N = input()
vals = map(int, input().split())
count = 0
is_odd = False
while True:
    for val in vals:
        if val % 2 == 1:
            is_odd = True
    if is_odd:
        break
    for i in xrange(N):
        vals[i] /= 2
    count += 1
print (count)

Buggy submission (verdict: Runtime Error):

N = input()
vals = map(int, input().split())
count = 0
is_odd = False
while True:
    for val in vals:
        if val % 2 == 1:
            is_odd = True
    if is_odd:
        break
    for i in range(N):
        vals[i] /= 2
    count += 1
print (count)

Buggy submission (verdict: Runtime Error):
N = input()
vals = input().split()
count = 0
while True:
    for val in vals:
        if val % 2 == 1:
            break
    else:
        count += 1
        vals = map(lambda x: x/2, vals)
        continue
    break
print (count)

Buggy submission (verdict: Runtime Error):
N = input()
vals = input().split()
count = 0
while True:
    for val in vals:
        if val % 2 == 1:
            break
    else:
        vals = map(lambda x: x/2, vals)
        continue
    break
print (count)
Problem p03495 (python)

Fixed submission:
N, K = map(int, input().split())
args = list(map(int, input().split()))
ballset = set(args)
balls = {}
for ball in ballset:
    balls[ball] = 0
for i in args:
    balls[i] += 1
count = len(ballset)
if count <= K:
    print (0)
else:
    print (sum(sorted(balls.values())[0:max(count-K, 0)]))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
args = map(int, input().split())
count = len(set(args))
balls = {}
for ball in count:
    balls[ball] = 0

for i in args:
    balls[i] += 1
if count <= K:
    print (0)
else:
    print (sum(sorted(balls.values())[0:max(count-K, 0)]))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
args = map(int, input().split())
count = len(set(args))
balls = {}
for ball in count:
    balls[ball] = 0

for i in args:
    balls[i] += 1
if count <= K:
    print (0)
else:
    print (sum(sorted(balls.values())[0:max(count-K, 0)]))
Problem p03545 (python)

Fixed submission:
import sys
A,B,C,D = map(int, list(input()))
if A+B+C+D==7:
    print("{}+{}+{}+{}=7".format(A,B,C,D))
    sys.exit()
if A+B-C+D==7:
    print("{}+{}-{}+{}=7".format(A,B,C,D))
    sys.exit()
if A+B+C-D==7:
    print("{}+{}+{}-{}=7".format(A,B,C,D))
    sys.exit()
if A+B-C-D==7:
    print("{}+{}-{}-{}=7".format(A,B,C,D))
    sys.exit()
if A-B+C+D==7:
    print("{}-{}+{}+{}=7".format(A,B,C,D))
    sys.exit()
if A-B-C+D==7:
    print("{}-{}-{}+{}=7".format(A,B,C,D))
    sys.exit()
if A-B+C-D==7:
    print("{}-{}+{}-{}=7".format(A,B,C,D))
    sys.exit()
if A-B-C-D==7:
    print("{}-{}-{}-{}=7".format(A,B,C,D))
    sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
A,B,C,D = map(int, input().split())
if A+B+C+D==7:
    print("A+B+C+D=7")
    sys.exit()
if A-B+C+D==7:
    print("A-B+C+D=7")
    sys.exit()
if A+B-C+D==7:
    print("A+B-C+D=7")
    sys.exit()
if A+B+C-D==7:
    print("A+B+C-D=7")
    sys.exit()
if A-B-C+D==7:
    print("A-B-C+D=7")
    sys.exit()
if A-B+C-D==7:
    print("A-B+C-D=7")
    sys.exit()
if A-B-C+D==7:
    print("A-B-C+D=7")
    sys.exit()
if A-B-C-D==7:
    print("A-B-C-D=7")
    sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
A,B,C,D = map(int, input().split())
if A+B+C+D==7:
    print("A+B+C+D==7")
    sys.exit()
if A-B+C+D==7:
    print("A-B+C+D==7")
    sys.exit()
if A+B-C+D==7:
    print("A+B-C+D==7")
    sys.exit()
if A+B+C-D==7:
    print("A+B+C-D==7")
    sys.exit()

if A-B-C+D==7:
    print("A-B-C+D==7")
    sys.exit()
if A-B+C-D==7:
    print("A-B+C-D==7")
    sys.exit()
if A-B-C+D==7:
    print("A-B-C+D==7")
    sys.exit()
if A-B-C-D==7:
    print("A-B-C-D==7")
    sys.exit()
Problem p03693 (python)

Fixed submission:
if int("".join(list(map(str, input().split())))) % 4 == 0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
if int("".join(list(map(int, input().split())))) % 4 == 0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
if int(list(map(int, input().split())).join()) % 4 == 0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
if int(map(int, input().split()).join()) % 4 == 0:
  print('YES')
else:
  print('NO')
Problem p03720 (python)

Fixed submission:

N, M = map(int, input().split())
cities = {}
for i in range(1, N+1):
    cities[i] = 0
for _ in range(0, M):
    a, b = map(int, input().split())
    cities[a] += 1
    cities[b] += 1
# 都市をkeyにしたdictを作って、その内容をインクリしていく?
for i in range(1, N+1):
    print (cities[i])

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
cities = {}
for i in range(0, N):
    cities[i] = 0
for _ in range(0, M):
    a, b = map(int, input().split())
    cities[a] += 1
    cities[b] += 1
# 都市をkeyにしたdictを作って、その内容をインクリしていく?
for i in range(0, N):
    print (cities[i])
Problem p03361 (python)

Fixed submission:
H, W = map(int, input().split())
S = []
S.append('.' * (W + 2))
S.extend(['.' + input() + '.' for _ in range(H)])
S.append('.' * (W + 2))

if ''.join(S).count('#') <= 1:
    print("Yes")
    quit()

for y in range(1, H + 1):
    for x in range(1, W + 1):
        if S[y][x] == '#' and set([S[y - 1][x], S[y + 1][x], S[y][x - 1], S[y][x + 1]]) == set('.'):
            print("No")
            quit()
print("Yes")

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = []
S.append('.' * (H + 2))
S.extend(['.' + input() + '.' for _ in range(H)])
S.append('.' * (H + 2))

if ''.join(S).count('#') <= 1:
    print("Yes")
    quit()

for y in range(1, H + 1):
    for x in range(1, W + 1):
        if S[y][x] == '#' and set([S[y - 1][x], S[y + 1][x], S[y][x - 1], S[y][x + 1]]) == set('.'):
            print("No")
            quit()
print("Yes")

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = []
S.append('.' * (H + 2))
S.extend(['.' + input() + '.' for _ in range(H)])
S.append('.' * (H + 2))

for y in range(1, H + 1):
    for x in range(1, W + 1):
        if S[y][x] == '#' and \
        set([S[y - 1][x], S[y + 1][x], S[y][x - 1], S[y][x + 1]]) == set('.'):
            print("No")
            quit()
print("Yes")

Buggy submission (verdict: Runtime Error):
def main():
    H, W = map(int, input().split())
    S = []
    S.append('.' * (H + 2))
    S.extend(['.' + input() + '.' for _ in range(H)])
    S.append('.' * (H + 2))

    for y in range(1, H + 1):
        for x in range(1, W + 1):
            if S[y][x] == '#' and \
            set([S[y - 1][x], S[y + 1][x], S[y][x - 1], S[y][x + 1]]) == set('.'):
                print("No")
                return
    print("Yes")

main()
Problem p03361 (python)

Fixed submission:
h, w = map(int, input().split())
field = []
field.append(list("." * (w + 2)))
for _ in range(h):
    field.append(list("." + input() + "."))
field.append(list("." * (w + 2)))

for y in range(1, h + 1):
    for x in range(1, w + 1):
        if field[y][x] == "#":
                if("#" in [field[y + 1][x], field[y - 1][x], field[y][x + 1], field[y][x - 1]]):
                    pass
                else:
                    print("No")
                    quit()

print("Yes")

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

for y in range(h):
    for x in range(w):
        if field[y][x] == "#":
            try:
                if("#" in [field[y + 1][x], field[y - 1][x], field[y][x + 1], field[y][x - 1]]):
                    pass
                else:
                    print("No")
                    quit()
            except IndexError:
                False

print("Yes")
Problem p03386 (python)

Fixed submission:
a, b, k = map(int, input().split())
s = set()
if b - a == 0:
    print(a)
elif b - a + 1 <= k:
    print(*range(a, b + 1), sep="\n")
else:
    for i in range(k):
        s.add(a + i)
        s.add(b - i)
    s = sorted(s)
    print(*s, sep="\n")

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
ls = list(range(a, b + 1))
lsRe = ls[::-1]
s = set()

if len(ls) > k:
    for i in range(k):
        s.add(ls[i])
        s.add(lsRe[i])
else:
    print(*ls, sep="\n")
    quit()

s = sorted(s)
print(*s, sep="\n")

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
ls = list(range(a, b + 1))
lsRe = ls[::-1]
s = set()

if len(ls) > k:
    for i in range(k):
        s.add(ls[i])
        s.add(lsRe[i])
else:
    print("ls", *ls, sep="\n")
    quit()

s = sorted(s)
print("set", *s, sep="\n")

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
ls = list(range(a, b + 1))
s = set()

if len(ls) > k:
    for i in range(k):
        s.add(ls[i])
        s.add(ls[len(ls) - (i + 1)])
else:
    print(*ls, sep="\n")
    quit()

print(*s, sep="\n")
Problem p03401 (python)

Fixed submission:
from collections import deque

n = int(input())
a = deque(map(int, input().split()))
a.appendleft(0)
a.append(0)

sum = sum([abs(a[i + 1] - a[i]) for i in range(len(a) - 1)])
ans = 0

for i in range(n):
    ans = sum
    ans = ans - abs(a[i + 1] - a[i]) - abs(a[i + 2] - a[i + 1]) + abs(a[i + 2] - a[i])
    print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque

n = int(input())
a = deque(map(int, input().split()))
a.appendleft(0)
a.append(0)
a = list(a)
kaisa = deque()
ans = list()

for i in range(len(a)):
    if i == 0:
        continue
    diff = a[i] - a[i - 1]
    kaisa.append(diff)


for i in range(n):
    ans = kaisa.copy()
    new_num = kaisa[i] + kaisa[i + 1]
    ans.remove(kaisa[i])
    ans.remove(kaisa[i + 1])
    ans.insert(i, new_num)
    print(sum([abs(n) for n in ans]))

Buggy submission (verdict: Runtime Error):
from collections import deque

n = int(input())
a = deque(map(int, input().split()))
a.appendleft(0)
a.append(0)
a = list(a)
kaisa = deque()
ans = deque()

for i in range(len(a)):
    if i == 0:
        continue
    diff = a[i] - a[i - 1]
    kaisa.append(diff)


for i in range(n):
    ans = kaisa.copy()
    new_num = kaisa[i] + kaisa[i + 1]
    ans.remove(kaisa[i])
    ans.remove(kaisa[i + 1])
    ans.insert(i, new_num)
    print(sum([abs(n) for n in ans]))

Buggy submission (verdict: Runtime Error):
from collections import deque

n = int(input())
a = deque(map(int, input().split()))
a.appendleft(0)
a.append(0)
a = list(a)
kaisa = deque()
ans = deque()
double_kaisa = deque()
for i in range(len(a)):
    if i == 0:
        continue
    diff = a[i] - a[i - 1]
    kaisa.append(diff)


for i in range(n):
    ans = kaisa.copy()
    new_num = kaisa[i] + kaisa[i + 1]
    ans.remove(kaisa[i])
    ans.remove(kaisa[i + 1])
    ans.insert(i, new_num)
    print(sum([abs(n) for n in ans]))
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(int, input())
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")
Problem p03605 (python)

Fixed submission:
n = input()
l = list(n)
if l[0] == "9" or l[1] == "9":
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(n)
if l[0] == 9 or l[1] == 9:
    print("Yes")
else:
    print("No")
Problem p03643 (python)

Fixed submission:
S = input()
print("ABC"+S)

Buggy submission (verdict: Runtime Error):
l = list(map(int, input().split()))
print("ABC"+l[0])
Problem p03679 (python)

Fixed submission:
l = list(map(int, input().split()))
border = l[1] - l[2]
if border < 0:
    if l[0] >= abs(border):
        print("safe")
    else:
        print("dangerous")
else:
    print("delicious")

Buggy submission (verdict: Runtime Error):
l = map(int, raw_input().split())
print(l[0])
print(l[1])
print(l[2])
if (l[2] - l[1]) <= 0:
    print("delicious")
elif (l[2] - l[1]) <= l[0]:
    print("safe")
else:
    print("dangerous")
Problem p03342 (python)

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

count = 0
Sum = 0
r = 0

for l in range(0, N):
    #Sum = A[l]
    while r < N and Sum + A[r] == Sum ^ A[r]:
            Sum += A[r]
            r += 1
    count += r-l
    if(l==r):
        r+=1
    else:
        Sum -= A[l]
    
    
print(count)

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

count = N
Sum = 0

for l in range(0, N-2):
    Sum = A[l]
    for r in range(l+1, N-1):
        if Sum + A[r] != Sum ^ A[r]:
            break
        else:
            Sum += A[r]
            #count += 1
    count += r-l-1
print(count)

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

l_max = len(A)
#print(l_max)
r = 0
count = l_max
Sums = 0
for l in range(0, l_max):
    for r in range(l+1, l_max):
       if Sums + A[r] == Sums ^ A[r]
            Sums += A[r]
            count += 1

print(count)
Problem p03501 (python)

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

Buggy submission (verdict: Runtime Error):
n = input()
if int(n) % sum(list(map(int, n))) == 0:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
priunt(min(a * n, b))
Problem p03341 (python)

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

arr=[]
num=0
for i in range(N-1):
	if S[i+1]=='E':
		num=num+1

arr.append(num)

for i in range(N-1):
	if S[i]=='W':
		if S[i+1]=='E':
			arr.append(arr[-1])
		else:
			arr.append(arr[-1]+1)
	elif S[i+1]=='E':
		arr.append(arr[-1]-1)
	else:
		arr.append(arr[-1])

print(min(arr))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=input().split(' ')

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

num=0
for i in range(N):
	plus=0
	xor=0
	for j in range(N-i):
		plus=plus+A[i+j]
		xor=xor^A[i+j]
		if plus==xor:
			num=num+1
		else:
			break

print(num)