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

Fixed submission:
s = input()

three ='RRR'
two ='RR'
one ='R'

if  three in s:
    print('3')
elif two in s:
    print('2')
elif one in s:
    print('1')
    
else :
    print('0')

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

ans = 0

l.sort()

for i in range(n) :
    for j in range(i+1,n):
        for k in range(j+1,n):
            if l[i] != l[j] != l[k] and  l[i] < l[j] < l[k]:
                    ans += 1

print(ans)
Problem p02584 (python)

Fixed submission:
x ,k ,d = map(int,input().split())

x = abs(x)
c = x // d
# 必要な移動回数
k_r = k - c
# 移動した後の残りの移動回数
ans_2 = x - d * c
#残り移動回数が偶数のときのｘからの距離

if c >= k:
    print(x - k * d )
    exit()

x_l = x - d * c
#ｘまでの残りの距離

if k_r % 2 == 0:
    print(ans_2)
    exit()
else :
    x_l -= d
    x_l =abs(x_l)
    print(x_l)

Buggy submission (verdict: Runtime Error):
c = x // d
# 必要な移動回数
k_r = k - c
# 移動した後の残りの移動回数
ans_2 = x - d * c
#残り移動回数が偶数のときのｘからの距離

if c >= k:
    print(x - k * d )
    exit()

x_l = x - d * c
#ｘまでの残りの距離

if k_r % 2 == 0:
    print(ans_2)
    exit()
else :
    x_l -= d
    x_l =abs(x_l)
    print(x_l)
Problem p03371 (python)

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

mast = max(x,y)
ans = float('INF')

for i in range(mast+1):
    price = a * max(x-i,0) + b * max(y-i,0) + c *2 *i
    ans =min(ans,price) 
    
print(ans)

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

mast = max(x,y)
ans = max(a * x + b * y,c *2 *i)

for i in range(mast+1):
    price = a * max(x-i,0) + b * max(y-i,0) + c *2 *i
    ans =min(ans,price) 
    
print(ans)

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

mast = max(x,y)
ans =  c *2 *i

for i in range(mast+1):
    price = a * max(x-i,0) + b * max(y-i,0) + c *2 *i
    ans =min(ans,price) 
    
print(ans)

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

mast = max(x,y)
ans =  c *2 *i

for i in range(mast+1):
    price = a * max(x-i,0) + b * max(y-i,0) + c *2 *i
    ans =min(ans,price) 
    
print(ans)
Problem p02615 (python)

Fixed submission:
import sys
import numpy as np

readline = sys.stdin.readline
read = sys.stdin.read

n = int(input())
a = np.array(readline().split(), dtype=np.int64)
a.sort()
a = a[::-1]
m = -(-n//2)
ans = np.sum(a[:m])*2 - a[0] if n % 2 == 0 else np.sum(a[:m])*2 - a[0] - a[m-1]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np

read = sys.stdin.read

n = int(input())
a = np.array(readline().split(), dtype=np.int64)
a.sort()
a = a[::-1]
m = -(-n//2)
ans = np.sum(a[:m])*2 - a[0] if n % 2 == 0 else np.sum(a[:m])*2 - a[0] - a[m]
print(ans)
Problem p02696 (python)

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

x = min(n,b-1)
ans = a*x//b - a*(x//b) 
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

a, b, n = map(int, input().split())
x = np.arange(1,n+1)
fx = (x*a)//b - (x//b)*a
print(np.max(fx))
Problem p02717 (python)

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

Buggy submission (verdict: Runtime Error):
x, y, z = map(int,input())
print(z, x, y)
Problem p03469 (python)

Fixed submission:
s = list(input())
s[3] = '8'
ans = "".join(s)
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np

read = sys.stdin.read

n = int(input())
d = np.array(read().split(), np.int64)

ans = len(np.unique(d))
print(ans)
Problem p03470 (python)

Fixed submission:
import sys
import numpy as np

read = sys.stdin.read

n = int(input())
d = np.array(read().split(), np.int64)

ans = len(np.unique(d))
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = np.array(read().split(), np.int64)

ans = len(np.unique(d))
print(ans)
Problem p03494 (python)

Fixed submission:
import sys
import numpy as np

readline = sys.stdin.readline

n = int(input())
a = np.array(readline().split(), dtype=np.int64)

ans = 0
while np.all(a&1 == 0):
    a >>= 1 
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

n = int(input())
a = np.array(readline().split(), dtype=np.int64)

ans = 0
while np.all(a&1 == 0):
    a >>= 1 
    ans += 1
print(ans)
Problem p03502 (python)

Fixed submission:
def sum_digits(n):
    s = 0
    while n:
        s += n%10
        n //= 10
    return s

n = int(input())

ans = "Yes" if n % sum_digits(n) == 0 else "No"
print(ans)

Buggy submission (verdict: Runtime Error):
def sum_digits(n):
    s = 0
    while n:
        s += n%10
        n //= 10
    retun s

n = int(input())

ans = "Yes" if n % sum_digits(n) == 0 else "No"
print(ans)
Problem p03545 (python)

Fixed submission:
import sys

a, b, c, d = input()

for i in range(2**3):
    op = ['','','']
    for j in range(3):
        if (i >> j) & 1:
            op[j] = '+'
        else:
            op[j] = '-'
    if eval(a + op[0] + b + op[1] + c + op[2] + d) == 7:
        print(a + op[0] + b + op[1] + c + op[2] + d + "=7")
        sys.exit()

Buggy submission (verdict: Runtime Error):
import sys

a, b, c, d = input()

for i in range(2**3):
    op = ['','','']
    for j in range(3):
        if (i >> j) & 1:
            op[j] = '+'
        else:
            op[j] = '-'
        if eval(a + op[0] + b + op[1] + c + op[2] + d) == 7:
            print(a + op[0] + b + op[1] + c + op[2] + d + "=7")
            sys.exit()

Buggy submission (verdict: Runtime Error):
import sys

a, b, c, d = input()

for i in range(2**3):
    op = ['','','']
    for j in range(len(3)):
        if (i >> j) & 1:
            op[j] = '+'
        else:
            op[j] = '-'
        if eval(a + op[0] + b + op[1] + c + op[2] + d) == 7:
            print(a + op[0] + b + op[1] + c + op[2] + d + "=7")
            sys.exit()
Problem p03555 (python)

Fixed submission:
c1 = list(input())
c2 = list(input())
ans = "YES" if c2 == c1[::-1] else "NO"
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np

readline = sys.stdin.readline

n = int(input())
a = np.array(readline().split(),dtype=np.int64)
b = np.array(readline().split(),dtype=np.int64)
c = np.array(readline().split(),dtype=np.int64)

ans = 0
for i in range(n):
    ans += np.count_nonzero(a < b[i]) * np.count_nonzero(c > b[i])
print(ans)

Buggy submission (verdict: Runtime Error):
c1 = list(input())
c2 = list(input())
ans = "YES" if c2 = c2[::-1] else "NO"
print(ans)
Problem p03573 (python)

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

ans = a if b == c else b if c == a else c
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np

readline = sys.stdin.readline

n = np.array(readline().split(), dtype=np.int64)

a = np.array(list(np.unique(n, return_counts=True))).T
ans = a[:,0][np.where(a[:,1] == 1)]
print(*ans)
Problem p03606 (python)

Fixed submission:
import sys
import numpy as np

read = sys.stdin.read

n = int(input())
p = np.array(read().split(), dtype=np.int64).reshape(-1,2)

ans = np.sum((p[:,1]-p[:,0])+1)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

read = sys.stdin.buffer.read

n = int(input())
p = np.array(read().split(), dtype=np.int64).reshape(-1,2)

ans = np.sum((p[:,1]-p[:,0])+1)
print(ans)
Problem p03624 (python)

Fixed submission:
import string

s = set(input())

a = set(string.ascii_lowercase)
b = sorted(list(a - s))
ans = b[0] if len(b) else "None"
print(ans)

Buggy submission (verdict: Runtime Error):
import string

s = set(input())

a = set(string.ascii_lowercase)
b = a - c
ans = b[0] if len(b) else "None"
print(ans)
Problem p03632 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
ans = max(0, min(b, d) - max(a, c))
print(ans)

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
ans = max(0, min(b, d)) - max(a, c))
print(ans)
Problem p03633 (python)

Fixed submission:
import numpy as np
from fractions import gcd

def lcm(x, y):
    return (x*y) // gcd(x, y)
ufunc = np.frompyfunc(lcm,2,1)

n = int(input())
t = np.array([int(input()) for i in range(n)])

ans = ufunc.reduce(t)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

n = int(input())
t = [int(input()) for i in range(n)]

ans = np.lcm.reduce(t)
print(ans)
Problem p03635 (python)

Fixed submission:
n, m = map(int, input().split())
ans = (n-1)*(m-1)
print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ans = (n-1)*(m-1)
print(ans))

Buggy submission (verdict: Runtime Error):
n, m = map(int, iput().split())
ans = (n-1)*(m-1)
print(ans))
Problem p03644 (python)

Fixed submission:
n = int(input())
for i in range(1,10):
    if 2**i > n:
        print(2**(i-1))
        break

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(1,10)
    if 2**i > n:
        print(2**(i-1))
Problem p03645 (python)

Fixed submission:
n, m = map(int, input().split())
c = set()
d = set()
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        c.add(b)
    if b == n:
        d.add(a)
ans = "POSSIBLE" if len(c & d) else "IMPOSSIBLE"
print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input())
c = set()
d = set()
for i in range(m):
    a, b = map(int, input())
    if a == 1:
        c.add(b)
    if b == n:
        d.add(a)
ans = "POSSIBLE" if len(c & d) else "IMPOSSIBLE"
Problem p03671 (python)

Fixed submission:
a, b, c =  map(int, input().split())
ans = min(a+b, b+c, c+a)
print(ans)

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

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

b = deque()
for i in range(n):
    b.append(a[i])
    b.reverse()

print(*b)
Problem p03672 (python)

Fixed submission:
s = list(input())

while True:
    s.pop()
    if s[:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        break

Buggy submission (verdict: Runtime Error):
s = deque(input())

while True:
    s.pop()
    if s[:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        break
Problem p03679 (python)

Fixed submission:
x, a, b = map(int, input().split())
ans = "delicious" if b <= a else "dangerous" if b > a+x else "safe"
print(ans)

Buggy submission (verdict: Runtime Error):
N = 10**6
mod = 10**9 + 7
fact = [1]
for i in range(1, N+1):
    fact.append(fact[-1]*i%mod)

n, m = map(int, input().split())

if n - m > 1 or m - n > 1:
    ans = 0
elif n - m == 0:
    ans = 2 * fact[n] * fact[m] % mod
else:
    ans = fact[n] * fact[m] % mod
    
print(ans)
Problem p03680 (python)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
check = [0 for i in range(n)]
now = 1
ans = 0
while check[now-1] == 0:
    if now == 2:
        print(ans)
        break
    check[now-1] = 1
    now = a[now-1]
    ans += 1
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
check = [0 for i in range(n)]
now = 0
ans = 0
while check[now] == 0:
    if now == 1:
        print(ans)
        break
    check[now] = 1
    now = a[now-1]
    ans += 1
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
check = [0 for i in rangen(n)]
now = 0
ans = 0
while check(now) != 0:
    if now == 1:
        print(ans)
        break
    check[now] = 1:
    now = a[now-1]
else:
    print(-1)
Problem p03681 (python)

Fixed submission:
N = 10**6
mod = 10**9 + 7
fact = [1]
for i in range(1, N+1):
    fact.append(fact[-1]*i%mod)

n, m = map(int, input().split())

if n - m > 1 or m - n > 1:
    ans = 0
elif n - m == 0:
    ans = 2 * fact[n] * fact[m] % mod
else:
    ans = fact[n] * fact[m] % mod
    
print(ans)

Buggy submission (verdict: Runtime Error):
N = 10**6
mod = 10**9 + 7
fact = [1]
for i in range(1, N+1):
    fact.append(fact[-1]*n%mod)


n, m = map(int, input())
ans = 0
if n - m > 1 or m - n > 1:
    ams = 0
elif n - m == 0:
    ans = 2 * (fact[n])**2
else:
    ans = fact[n] * fact[m)
print(ans)

Buggy submission (verdict: Runtime Error):
n = 10**6
mod = 10**9 + 7
fact = [1]
for i in range(1, n+1):
    fact.sppend(fact[-1]*n%mod)


n, m = map(int, input())
ans = 0
if n - m > 1 or m - n > 1:
    ams = 0
elif n - m == 0:
    ans = 2 * (fact[n])**2
else:
    ans = fact[n] * fact[m)
print(ans)
Problem p03693 (python)

Fixed submission:
a = int(''.join(input().split()))
ans = "YES" if a%4 == 0 else "NO"
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

n = int(input())
a = np.array(list(map(int, input().split())))

c = np.where(a < 3200, a//400, 8)
j = np.count_nonzero(c == 8)
ans = min(8, len(np.unique(c)) - 1 + j) if j else len(np.unique(c))
print(ans)
Problem p03694 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [map(int, input().split())]
ans = max(a) - min(a)
print(ans)
Problem p03699 (python)

Fixed submission:
import sys

n = int(input())
s = [int(input()) for i in range(n)]

s.sort()
p = sum(s)
if p%10 != 0:
    print(p)
    sys.exit()
for i in s:
    if i % 10 != 0:
        print(p - i)
        sys.exit()
print(0)

Buggy submission (verdict: Runtime Error):
import sys

n = int(input())
s = [int(input()) for i in range(n)]

s.sort()
p = np.sum(s)
if p%10 != 0:
    print(p)
    sys.exit()
for i in s:
    if i % 10 != 0:
        print(p - i)
        sys.exit()
print(0)
Problem p03719 (python)

Fixed submission:
a, b, c = map(int,input().split())
ans = 'Yes' if a <= c <= b else 'No'
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = map(int,input().split())
c = np.zeros(n)
for i in range(m)
    a, b = map(int,input().split())
    c[a-1] + 1
    c[b-1] + 1
for i in c:
    print(i)
Problem p03720 (python)

Fixed submission:
n, m = map(int,input().split())
c = [0 for i in range(n)]
for i in range(m):
    a, b = map(int,input().split())
    c[a-1] += 1
    c[b-1] += 1
for i in range(n):
    print(c[i])

Buggy submission (verdict: Runtime Error):
n, m = map(int,input().split())
c = [0 for i in range(n)]
for i in range(m)
    a, b = map(int,input().split())
    c[a-1] += 1
    c[b-1] += 1
for i in len(c):
    print(c[i])

Buggy submission (verdict: Runtime Error):
n, m = map(int,input().split())
c = [0 for i in range(n)]
for i in range(m)
    a, b = map(int,input().split())
    c[a-1] += 1
    c[b-1] += 1
for i in c:
    print(i)

Buggy submission (verdict: Runtime Error):
import numpy as np
n, m = map(int,input().split())
c = np.zeros(n)
for i in range(m)
    a, b = map(int,input().split())
    c[a-1] + 1
    c[b-1] + 1
for i in c:
    print(i)

Buggy submission (verdict: Runtime Error):
n, m = map(int,input().split())
c = np.zeros(n)
for i in range(m)
    a, b = map(int,input().split())
    c[a-1] + 1
    c[b-1] + 1
for i in c:
    print(i)
Problem p03760 (python)

Fixed submission:
from collections import deque

o = deque(input())
e = deque(input())

if len(o) > len(e):
    e.append('')
ans = ''

while len(o):
    ans += o.popleft()
    ans += e.popleft()
print(ans)

Buggy submission (verdict: Runtime Error):
o = deque(input())
e = deque(input())

if len(o) > len(e):
    e.append('')
ans = ''

while len(o):
    ans += o.popleft()
    ans += e.popleft()
print(ans)
Problem p03773 (python)

Fixed submission:
a, b = map(int, input().split())
ans = (a+b)%24
print(ans)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
ans = (a+b)%24
print(ans)
Problem p03777 (python)

Fixed submission:
a,b = input().split()
ans = 'H' if a == b else 'D'
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
x = int(input())
i = 1
while True:
    if i*(i+1)//2 >= x:
        print(i)
        sys.exit() 
    i += 1
Problem p03778 (python)

Fixed submission:
w, a, b = map(int,input().split())
ans = 0
if b+w < a:
    ans = a - (b+w)
if a+w < b:
    ans = b - (a+w)
print(ans)

Buggy submission (verdict: Runtime Error):
w, a, b = map(int,input())
ans = 0
if b+w < a:
    ans = a - (b+w)
if a+w < b:
    ans = b - (a+w)
print(ans)
Problem p03779 (python)

Fixed submission:
import sys
x = int(input())
i = 1
while True:
    if i*(i+1)//2 >= x:
        print(i)
        sys.exit() 
    i += 1

Buggy submission (verdict: Runtime Error):
import sys
x = int(input())
i = 1
while True:
    if i*(i+1)//2 >= x:
        print(i):
        sys.exit() 
    i += 1
Problem p03796 (python)

Fixed submission:
n = int(input())
mod = 10**9 + 7
ans = 1
for i in range(1, n+1):
    ans *= i
    ans %= mod

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
mod = 10**9 + 7
for i in range(1, n+1):
    ans *= i
    ans %= mod

print(ans)

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
@lru_cache(maxsize=None)
def fac(n, mod = 10**9+7):
    if n == 0:
        return 1
    else:
        return fac(n-1) * n % mod

n = int(input())
print(fac(n))
Problem p03814 (python)

Fixed submission:
import itertools
s = list(input())
s1 = list(itertools.dropwhile(lambda x: x != 'A',s))
s2 = list(itertools.dropwhile(lambda x: x != 'Z',s1[::-1]))
print(len(s2))

Buggy submission (verdict: Runtime Error):
s = list(input())
s1 = list(dropwhile(lambda x: x != 'A',s))
s2 = list(dropwhile(lambda x: x != 'Z',s1[::-1]))
print(len(s2))
Problem p03815 (python)

Fixed submission:
x = int(input())
ans = (x//11)*2 if x%11 == 0 else (x//11)*2 + 1 if x%11 <= 6 else (x//11)*2 + 2
print(ans)

Buggy submission (verdict: Runtime Error):
x = list(input())
ans = (x//11) * 2 + 1 if x%11 <=5 else (x//11) * 2 + 2
print(ans)
Problem p03816 (python)

Fixed submission:
n = int(input())
a = set(map(int,input().split()))
ans = len(a) if len(a)%2 == n%2 else len(a)-1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = set(map, input().split())
ans = len(a) if len(a)%2 == n%2 else len(a)-1
print(ans)
Problem p03826 (python)

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

ans = max(a*b, c*d)
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

n = int(input())
s = list(input())
s1 = [1 if s[i] == 'I' else -1 for i in range(n)]
cumsum = list(itertools.accumulate(s1))
print(s1)
print(cumsum)
ans = max(cumsum)
print(max(ans, 0))
Problem p03827 (python)

Fixed submission:
import itertools

n = int(input())
s = list(input())
s1 = [1 if s[i] == 'I' else -1 for i in range(n)]
cumsum = list(itertools.accumulate(s1))
ans = max(cumsum)
print(max(ans, 0))

Buggy submission (verdict: Runtime Error):
import itertools

n = int(input())
s = list(input())
s1 = [1 if s[i] == 'I' else -1 for i in range(n)]
cumsum = list(itertools.accumulate(s1))
print(s1)
print(cumsum)
ans = max(cumsum)
print(max(ams, 0))

Buggy submission (verdict: Runtime Error):
import itertools

n = int(input())
s = list(input())
s1 = [1 if s[i] == 'I' else -1 for i in range(n)]
cumsum = list(itertools.accumulate(s1))
print(s1)
print(cumsum)
ans = max(cumsum)
print(max(ams, 0))
Problem p03844 (python)

Fixed submission:
i = list(input().split())
if i[1] == '+':
    ans = int(i[0]) + int(i[2])
else:
    ans = int(i[0]) - int(i[2])
print(ans)

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

mod = 10**9 + 7
n = int(input())
a = deque(sorted(list(map(int, (input().split())))))
if n % 2 == 0:
    for i in range(n//2):
        b = a.popleft()
        c = a.popleft()
        if b != i*2+1 or c != i*2+1:
            print(0)
            sys.exit()
    print(pow(2, n//2, mod))

if n % 2 == 1:
    if a.popleft() != 0:
        print(0)
        sys.exit()
    for i in range(n//2):
        b = a.popleft()
        c = a.popleft()
        if b != (i+1)*2 or c != (i+1)*2:
            print(0)
            sys.exit()
    print(pow(2, n//2, mod))
Problem p03845 (python)

Fixed submission:
n = int(input())
t = list(map(int, (input().split())))
T = sum(t)
m = int(input())
for i in range(m):
    p, x = map(int, input().split())
    print(T - t[p-1] + x)

Buggy submission (verdict: Runtime Error):
n = int(input())
t = list(map(int, (input().split()))
time = sum(t)
m = int(input())
for i in range(m)
    p, x = map(int, input()/split())
    pritn(time - t[p+1] + x)
Problem p03846 (python)

Fixed submission:
import sys
from collections import deque


mod = 10**9 + 7
n = int(input())
a = deque(sorted(list(map(int, (input().split())))))
if n % 2 == 0:
    for i in range(n//2):
        b = a.popleft()
        c = a.popleft()
        if b != i*2+1 or c != i*2+1:
            print(0)
            sys.exit()
    print(pow(2, n//2, mod))

if n % 2 == 1:
    if a.popleft() != 0:
        print(0)
        sys.exit()
    for i in range(n//2):
        b = a.popleft()
        c = a.popleft()
        if b != (i+1)*2 or c != (i+1)*2:
            print(0)
            sys.exit()
    print(pow(2, n//2, mod))

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

mod = 10**9 + 7
n = int(input())
a = deque(sorted(list(map(int, (input().split())))))

if n % 2 == 0:
    for i in range(n//2):
        b = a.pop()
        c = a.pop()
        if b == (i+1)*2 and c = (i+1)*2:
            print(0)
            sys.exit()
    print(pow(2, n//2, mod))

if n % 2 == 1:
    if a.pop() != 0:
        print(0)
        sys.exit()
    for i in range(n//2):
        b = a.pop()
        c = a.pop()
        if b == (i+1)*2 and c = (i+1)*2:
            print(0)
            sys.exit()
    print(pow(2, n//2, mod))
Problem p03852 (python)

Fixed submission:
c = input()
if c == 'a' or c == 'e' or c == 'i' or c == 'o' or c == 'u':
    print("vowel")
else:
    print("consonant")

Buggy submission (verdict: Runtime Error):
c = input()
if c == ('a' or 'b' or 'c' or 'd' or 'e'):
    print(vowel)
else:
    print(consonant)
Problem p03860 (python)

Fixed submission:
a, s, c = input().split()
print(a[0]+s[0]+c[0])

Buggy submission (verdict: Runtime Error):
a, s, c = map(int,input().split())
print(a[0]+s[0]+c[0])
Problem p03943 (python)

Fixed submission:
n = list(map(int,input().split()))
n.sort()
if n[0] + n[1] == n[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = list(map(int,input().split()))
n.sorted()
if n[0] + n[1] == n[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = list(map(int,input()))
n.sorted()
if n[0] + n[1] == n[2]:
    print("Yes")
else:
    print("No")
Problem p03962 (python)

Fixed submission:
s =set(input().split())
print(len(s))

Buggy submission (verdict: Runtime Error):
from math import ceil,floor
import sys
n = int(input())
T = [0 for i in range(n)]
A = [0 for i in range(n)]
for i in range(n):
    T[i],A[i] = map(int,input().split())
t = 1
a = 1
for i in range(n):
    t = T[i]*max(ceil(t/T[i]), ceil(a/A[i]))
    a = A[i]*max(ceil(t/T[i]), ceil(a/A[i]))

print(t+a)
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
ans = (a+b)*h//2
print(ans)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
h = int(input())
ans = (a+b)*h//2
input(ans)
Problem p04011 (python)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n-k > 0:
    ans = x*k + y*(n-k)
    print(ans)
else:
    ans = x*n
    print(ans)

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

if n-k > 0:
    ans = x*k + y+(n-k)
    print(ans)
else:
    ans = x*n
    print(ans)
Problem p04012 (python)

Fixed submission:
import sys
w = input()
checker = set(w)
for i in checker:
    if w.count(i)%2 == 1:
        print("No")
        sys.exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
vimport sys
w = input()
checker = set(w)
for i in checker:
    if w.count(i)%2 == 1:
        print("No")
        sys.exit()
print("Yes")