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

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

n=int(input())
edge=[[]for i in range(n+1)]

for i in range(n-1):
    u,v,w=map(int,input().split())
    if w%2==0:
        edge[u].append((v,1))
        edge[v].append((u,1))
    else:
        edge[u].append((v,-1))
        edge[v].append((u,-1))
        
color=[None]*(n+1)

def set_color(x,col):
    color[x]=col
    
    for i,j in edge[x]:
        if color[i] is None:
            set_color(i,j*col)

set_color(1,1)
for i in color[1:]:
    print((i+1)//2)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
n = int(input())
edge = [[] for _ in range(n)]

for i in range(n-1):
    s, g, d = map(int, input().split())
    edge[s-1].append((g, d%2))
    edge[g-1].append((s, d%2))

ans = [None for _ in range(n)]

def set_color(x, col):
    ans[x-1] = col
    print(ans, edge[x-1])
    for g, d in edge[x-1]:
        if ans[g-1] == None:
            set_color(g, d^col)

set_color(1, 0)
for i in range(n):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
edge = [[] for _ in range(n)]

for i in range(n-1):
    s, g, d = map(int, input().split())
    edge[s-1].append((g, d%2))
    edge[g-1].append((s, d%2))

ans = [None for _ in range(n)]

def set_color(x, col):
    ans[x-1] = col
    print(ans, edge[x-1])
    for g, d in edge[x-1]:
        if ans[g-1] == None:
            set_color(g, d^col)

set_color(1, 0)
for i in range(n):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
import networkx as nx
graph = nx.Graph() #無向グラフを作成
directed_graph = nx.DiGraph() #有向グラフを作成

n = int(input())
for i in range(n-1):
    tree = list(map(int, input().split()))
    graph.add_edge(tree[0], tree[1])
    graph.edges[tree[0], tree[1]]['range'] = tree[2]
for i in range(n):
    graph.nodes[i+1]['color'] = 0

print(0)
for i in range(1,n):
    path = nx.shortest_path(graph, source=1, target=i+1)
    graph.nodes[i+1]['color'] = sum([graph.edges[path[i], path[i+1]]['range'] for i in range(len(path)-1)])%2
    print(graph.nodes[i+1]['color'])
Problem p03061 (python)

Fixed submission:
import fractions as math

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

l = [a[0] for _ in range(n+2)]
r = [a[-1] for _ in range(n+2)]

for i in range(n):
    l[i+1] = math.gcd(l[i], a[i])
    r[-(i+2)] = math.gcd(r[-(i+1)], a[-(i+1)])
l[0] = r[0] = l[-1] = r[-1] = 0

ans = [math.gcd(l[i], r[i+2]) for i in range(n)]
print(max(ans))

Buggy submission (verdict: Runtime Error):
import math

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

l = [a[0] for _ in range(n+2)]
r = [a[-1] for _ in range(n+2)]

for i in range(n):
    l[i+1] = math.gcd(l[i], a[i])
    r[-(i+2)] = math.gcd(r[-(i+1)], a[-(i+1)])
l[0] = r[0] = l[-1] = r[-1] = 0

ans = [math.gcd(l[i], r[i+2]) for i in range(n)]
print(max(ans))
Problem p02813 (python)

Fixed submission:
from itertools import permutations
n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
a, b = 0, 0
for i, x in enumerate(permutations(range(1, n + 1), n)):
    if x == p:
        a = i
    if x == q:
        b = i
print(abs(a - b))

Buggy submission (verdict: Runtime Error):
from itertools import permutations
n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
a, b = int()
for i, x in enumerate(permutations(range(1, n + 1), n)):
    if x == p:
        a = i
    if x == q:
        b = i
print(abs(a - b))
Problem p02898 (python)

Fixed submission:
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
ans = 0
for j in h:
    if j >= k:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(i) for i in input().split()]
ans = 0
for j in h:
    for j >= k:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(i) for i in range(n)]
ans = 0
for j in h:
    for j >= k:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]
ans = 0
for i in h:
    for i >= k:
        ans += 1
print(ans)
Problem p02911 (python)

Fixed submission:
n, k, q = map(int, input().split())
point = [k - q] * n

for i in range(q):
    answer = int(input())
    point[answer - 1] += 1

for j in point:
    if j <= 0:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
point = [k - q] * n

for i in range(q):
    answer = int(input())
    point[answer - 1} += 1

for j in point:
    if j <= 0:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
point = [k - q] * n

for i in range(q):
    answer = int(input())
    point[answer - 1} += 1

for j in point:
    if p <= 0:
        print('No')
    else:
        print('Yes')
Problem p02982 (python)

Fixed submission:
n, d = map(int, input().split())
x = [[int(j) for j in input().split()] for i in range(n)]
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        acum = 0.0
        for k in range(d):
            acum += (x[j][k] - x[i][k]) ** 2
        if (acum ** 0.5).is_integer():
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n, d = map(int, input().split())
x = [[int(j) for j in input().split()] for i in range(n)]
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        acum = 0.0
        for k in range(d)
            acum += (x[j][k] - x[i][k]) ** 2
        if (acum ** 0.5).is_integer():
            ans += 1
print(ans)
Problem p02988 (python)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]
ctn = 0
for j in range(1, n-1):
    if p[j - 1] < p[j] < p[j + 1] or p[j + 1] < p[j] < p[j - 1]:
        ctn += 1
print(ctn)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = [int(i) for i in input().split()]
ctn = 0
for j in range(1, n-2):
    if p[j -1] < p[j] < p[j + 1]
        ctn += 1
print(ctn)
Problem p02994 (python)

Fixed submission:
n, l = map(int, input().split())
a = range(l, l + n)
print(sum(a) - min(a, key=abs))

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
a = range(l. l + n)
print(sum(a) - min(a, key=abs))
Problem p03060 (python)

Fixed submission:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i in range(n):
    d = v[i] - c[i]
    if 0 < d:
        ans += d
print(int(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i range(n):
    d = v[i] - c[i]
    if 0 < d:
        ans += d
print(int(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
d = 0
for i range(n):
    d = v[i] - c[i]
    if 0 < d:
        ans += d
print(int(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split))
c = list(map(int, input().split))
d = 0
for i range(n):
    d = v[i] - c[i]
    if 0 < d:
        ans += d
print(int(ans))
Problem p03061 (python)

Fixed submission:
from fractions import gcd
n = int(input())
aaa = list(map(int, input().split()))
p = aaa[0]
f = [p]
for a in aaa[1:-1]:
    p = gcd(p, a)
    f.append(p)
aaa.reverse()
p = aaa[0]
b = [p]
for a in aaa[1:-1]:
    p = gcd(p, a)
    b.append(p)
b.reverse()

f = [b[0]] + f
b = b + [f[-1]]

print(max(gcd(p, q) for p, q in zip(f, b)))

Buggy submission (verdict: Runtime Error):
def gcd(x, y):
if y == 0:
    return x
else:
    return gcd(y, x % y)

n = int(input())
aaa = list(map(int, input().split()))
cnt_l = [0] * (n - 1)
cnt_r = [0] * (n - 1)

cnt_l[0] = aaa[0]
for i in range(1, n - 1):
cnt_l[i] = gcd(cnt_l[i - 1], aaa[i])

aaa.reverse()
cnt_r[0] = aaa[0]
for i in range(1, n - 1):
cnt_r[i] = gcd(cnt_r[i - 1], aaa[i])

cnt_l = [cnt_r[-1]] + cnt_l
cnt_r = [cnt_l[-1]] + cnt_r
cnt_r.reverse()

ans = 0
for i in range(n - 1):
tmp = gcd(cnt_l[i], cnt_r[i])
ans = max(ans, tmp)

print(ans)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
n = int(input())
aaa = list(map(int, input().split()))
p = aaa[0]
f = [p]
for a in aaa[1:-1]:
    p = gcd(p, a)
    f.append(p)
aaa.reverse()
p = aaa[0]
b = [p]
for a in a[1:-1]:
    p = gcd(p, a)
    b.append(p)
f = [b[0]] + f
b = b + [f[-1]]
print(max(gcd(p, q)) for p, q in zip(f, b))
Problem p03076 (python)

Fixed submission:
l = [int(input()) for _ in range(5)]
ans = 0
m = 0
for i in l:
    if i % 10 != 0:
        p = 10 - i % 10
    else:
        p = 0
    ans += i + p
    m = max(m, p)
print(ans - m)

Buggy submission (verdict: Runtime Error):
l = [int(input()) for _ in range(5)]
ans = 0
p = 0
for i in l:
    if i % 10 != 0:
        p = 10 - i % 10
    else:
        p = 0
    ans += i + p
    m = max(m, p)
print(ans - m)

Buggy submission (verdict: Runtime Error):
l = [int(input()) for _ in range(5)]
ans = 0
for j in range(5):
    if 0 < l[j] % 10:
        ans += (l[j] // 10 + 1) * 10
    else:
        ans += l[j]
l %= 10
ans -= min(l)
ans += 10
print(ans)

Buggy submission (verdict: Runtime Error):
l = [int(input()) for _ in range(5)]
ans = 0
for j in range(5):
    if 0 < l[j] % 10 and min(l % 10) == l[j]:
        ans += l[j]
    elif 0 < l[j] % 10:
        ans += (l[j] // 10 + 1) * 10
    else:
        ans += l[j]
print(ans)

Buggy submission (verdict: Runtime Error):
l = [int(i) for i in input()]
ans = 0
for j in l:
    if 0 < l[j] % 10:
        ans += (l[j] % 10 + 1) * 10
    else:
        ans += l[j]
print(ans)
Problem p03086 (python)

Fixed submission:
s = list(input())
ctn = 0
m = 0
for i in s:
    if i in ['A', 'C', 'G', 'T']:
        ctn += 1
        m = max(m, ctn)
    else:
        ctn = 0
print(m)

Buggy submission (verdict: Runtime Error):
s = list(input())
ctn = 0
for i in s:
    if i in ['A', 'G', 'C', 'T']:
        ctn += 1
        m = max(m, ctn)
    else:
        ctn = 0
print(ctn)
Problem p03087 (python)

Fixed submission:
n, q = map(int, input().split())
s = list(input())
lrs = [list(map(int, input().split())) for _ in range(q)]
d = [0] * n
cnt = 0
for i in range(n-1):
    if s[i:i + 2] == ['A', 'C']:
        cnt += 1
    d[i+1] = cnt
for j in range(q):
    l, r = lrs[j][0], lrs[j][1]
    print(d[r - 1] - d[l - 1])

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
sss = list(input())
cnt = [0] * (n + 1)
for i in range(1, n + 1):
    if sss[i - 1] == 'A' and sss[i] == 'C':
        cnt[i] += cnt[i - 1] + 1
    else:
        cnt[i] += cnt[i - 1]

for _ in range(q):
    li, ri = map(int, input().split())
    print(cnt[ri - 1] - cnt[li - 1])
Problem p03102 (python)

Fixed submission:
n, m, c = map(int, input().split())
b = [int(i) for i in input().split()]
a = [[int(j) for j in input().split()] for _ in range(n)]
ans = 0
for k in range(n):
    ct = c
    for l in range(m):
        ct += a[k][l] * b[l]
    if ct > 0:
        ans += 1
    ct = 0
print(ans)

Buggy submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = [int(i) for i in input().split()]
a = [[int(input()) for _ in range(m)] for _ in range(n)]
ans = 0
ctn = 0
for j in range(n):
    for k in range(m):
        ctn += b[k] * a[j][k]
    if ctn + c > 0:
        ans += 1
    ctn = 0
print(ans)

Buggy submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = [int(i) for i in input().split()]
a = [[int(input()) for _ in range(m)] for _ in range(n)]
ans = 0
ctn = 0
for j in range(n):
    for k in range(m):
        ctn += b[n] * a[n][m]
    if ctn - c > 0:
        ans += 0
    ctn = 0
print(ans)
Problem p03106 (python)

Fixed submission:
a, b, k = map(int, input().split())
ans = []
for i in range(1, 101):
    if a % i == 0 and b % i == 0:
        ans.append(i)
print(ans[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
ans = []
for i in range(1, min(a, b)):
    if a % i == 0 and b % i == 0:
        ans.append(i)
print(ans[-k])
Problem p03110 (python)

Fixed submission:
n = int(input())
l = [input().split() for _ in range(n)]
ans = 0
for x, u in l:
    x = float(x)
    if u == 'JPY':
        ans += x
    else:
        ans += x * 380000
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans, a = 0, 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY'
        ans += x
    else:
        ans += x * 380000
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY'
        ans += x
    else:
        ans += x * 380000
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == 'JPY'
        ans += x
    else:
        ans += x * 380000
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for j in l:
    x, u = input().split()
    if u == 'JPY'
        ans += int(x)
    else:
        ans += float(x) * 380000
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [input().split() for i in range(n)]
ans = 0
for j in range(n):
    if l[j][1] == 'JPY'
        ans += int(l[j][0])
    else:
        ans += int(l[j][0]) * 380000
print(ans)
Problem p03125 (python)

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

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
cnt = [0] * m
for _ in range(n):
    k, *a = map(int, input().split())
    for A in a:
        cnt[A - 1] += 1
print(sum(c == n for c in cnt))
Problem p03206 (python)

Fixed submission:
print({25 : 'Christmas', 24 : 'Christmas Eve', 23 : 'Christmas Eve Eve', 22 : 'Christmas Eve Eve Eve'}[int(input())])

Buggy submission (verdict: Runtime Error):
print({25 : 'Christmas', 24 : 'Christmas Eve', 23 : 'Christmas Eve Eve', 22 : 'Christmas Eve Eve Eve'}[input()])
Problem p03238 (python)

Fixed submission:
n = int(input())
print('Hello World' if n == 1 else int(input()) + int(input()))

Buggy submission (verdict: Runtime Error):
n = int(input())
a, b = map(int, input().split())
if a == 1:
  print('Hellp World')
else:
  print(a + b)
Problem p03240 (python)

Fixed submission:
n = int(input())
xyh = []
x0, y0, h0 = None, None, None
for _ in range(n):
    x, y, h = map(int, input().split())
    if h > 0 and x0 is None:
        x0, y0, h0 = x, y, h
    xyh.append([x, y, h])

for cx in range(101):
    for cy in range(101):
        h = h0 + abs(x0 - cx) + abs(y0 - cy)
        done = True
        for xk, yk, hk in xyh:
            h_ = max(h - abs(xk - cx) - abs(yk - cy), 0)
            if h_ != hk:
                done = False
                break
        if done:
            print(f'{cx} {cy} {h}')

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

def answer(cx, cy, xyh):
    h_list = []
    flag = True
    for x, y, h in xyh:
        if h > 0:
            tmp_h = abs(x - cx) + abs(y - cy) + h
            h_list.append(tmp_h)
        if min(h_list) != max(h_list):
            flag = False
    if flag:
        return print(cx, cy, h_list[0], sep=' ')

for cx in range(0, 101):
    for cy in range(0, 101):
        answer(cx, cy, xyh)
Problem p03337 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(max(a + b, a - b, ab))
Problem p03369 (python)

Fixed submission:
s = input()
print(700 + 100 * s.count('o'))

Buggy submission (verdict: Runtime Error):
s = input()
print(700 + 100 * s.count())

Buggy submission (verdict: Runtime Error):
s = list(map(str, input().split()))
ctn = 0
for i in range(3):
  if s[i] == 'o':
    ctn += 1
print(700 + 100 * ctn)
Problem p03385 (python)

Fixed submission:
s = list(input())
s.sort()
print('Yes' if ''.join(s) == 'abc' else 'No')

Buggy submission (verdict: Runtime Error):
s = input()
s.sort()
print('Yes' if ''.join(s) == 'abc' else 'No')

Buggy submission (verdict: Runtime Error):
s = input()
s.sort()
print('Yes' if s == 'abc' else 'No')
Problem p03433 (python)

Fixed submission:
n = int(input())
a = int(input())
print('Yes' if n % 500 <= a else 'No')

Buggy submission (verdict: Runtime Error):
print('Yes' if int(input()) % 500 <= a else 'No')
Problem p03504 (python)

Fixed submission:
n, c = map(int, input().split())
cnt = [[0 for _ in range(10 ** 5 + 1)] for _ in range(c)]

for _ in range(n):
    s, t, _c = map(int, input().split())
    for j in range(s, t + 1):
        cnt[_c - 1][j] = 1
ans = 0
for i in range(10 ** 5 + 1):
    ans = max(ans, sum(cnt[j][i] for j in range(c)))
print(ans)

Buggy submission (verdict: Runtime Error):
n, c = map(int, input().split())
cnt = [0] * (10 ** 5 + 1)
cnt_sum = [0] * (10 ** 5 + 1)
for _ in range(n):
    s, t, _c = map(int, input().split())
    cnt[s] += 1
    cnt[t + 1] -= 1
cnt_sum[0] = cnt[0]
for i in range(1, 10 ** 5 + 1):
    cnt_sum[i] = cnt_sum[i - 1] + cnt[i]
print(max(cnt_sum))
Problem p03543 (python)

Fixed submission:
n = list(input())
if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = list(input())
if list[0] == list[1] == list[2] or list[1] == list[2] == list[3]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = list(input())
if (list[0] == list[1] and list[1] == list[2]) or (list[1] == list[2] and list[2] == list[3]):
    print('Yes')
else:
    print('No')
Problem p03547 (python)

Fixed submission:
x, y = input().split()
 
if x > y:
    print('>')
elif x < y:
    print('<')
else:
    print('=')

Buggy submission (verdict: Runtime Error):
x, y = input().split()
if x = y:
    print('=')
elif x < y:
    print('<')
else:
    print('>')
Problem p03555 (python)

Fixed submission:
c1 = list(input())
c2 = list(input())
c1.reverse()
print('YES' if c1 == c2 else 'NO')

Buggy submission (verdict: Runtime Error):
c1 = input()
c2 = input()
print('Yes' if c1 == c2.reverse() else 'No')
Problem p03605 (python)

Fixed submission:
n = input()
print('Yes' if n.count('9') else 'No')

Buggy submission (verdict: Runtime Error):
n = int(input())
print(n.count(9))
Problem p03679 (python)

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

Buggy submission (verdict: Runtime Error):
x, a, b = map(int, input().split)
if a >= b:
    print('delicious')
elif x + a < b:
    print('dangerous')
else:
    print('safe')
Problem p03693 (python)

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

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

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

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

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

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

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

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input(),split())
if c >= a and c <= b:
    print('Yes')
else:
    print('No')
Problem p03729 (python)

Fixed submission:
a, b, c = list(input().split(' '))
if a[-1] == b[0] and b[-1] == c[0]:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a, b, c = list(input().split(' '))
if a[-1] = b[0] and b[-1] = c[0]:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a, b, c = map(list, input().split(' '))
if a[-1] = b[-1] and b[-1] = c[-1]:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a, b, c = list(input().split(' '))
if a[-1] = b[-1] and b[-1] = c[-1]:
    print('YES')
else:
    print('NO')
Problem p03795 (python)

Fixed submission:
n = int(input())
cb = int((n // 15) * 200)
print(800 * n - cb)

Buggy submission (verdict: Runtime Error):
n = int(input())
cb = int((n // 15) * 200
print(800 * n - cb)
Problem p03846 (python)

Fixed submission:
def pow_mod(n, k, m):
    if k == 0:
        return 1
    if k & 1:
        return (pow_mod(n, k - 1, m) * n % m) % m
    else:
        return (pow_mod(n, k // 2, m) ** 2) % m

n = int(input())
aaa = list(map(int, input().split()))
mod = 10 ** 9 + 7
aaa.sort()
if n % 2 == 0:
    for i in range(0, n, 2):
        if aaa[i] != aaa[i + 1]:
            print(0)
            exit()
    print(pow_mod(2, (n // 2), mod))
else:
    for i in range(1, n, 2):
        if aaa[i] != aaa[i + 1]:
            print(0)
            exit()
    print(pow_mod(2, ((n - 1) // 2), mod))

Buggy submission (verdict: Runtime Error):
n = int(input())
aaa = list(map(int, input().split()))
aaa.sort()
if n % 2 == 0:
    for i in range(0, n, 2):
        if aaa[i] != aaa[i + 1]:
            print(0)
            exit()
    print(2 ** (n / 2) % (10 ** 9 + 7))
else:
    for i in range(1, n, 2):
        if aaa[i] != aaa[i + 1]:
            print(0)
            exit()
    print(2 ** ((n - 1) / 2) % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
n = int(input())
aaa = list(map(int, input().split()))
aaa.sort()
ans = int(2 ** (n / 2) % (10 ** 9 + 7)) if n % 2 == 0 else int(2 ** ((n - 1) / 2) % (10 ** 9 + 7))
if n % 2 == 0:
    for i in range(0, n, 2):
        if aaa[i] != aaa[i + 1]:
            ans = 0
            break
else:
    for i in range(1, n, 2):
        if aaa[i] != aaa[i + 1]:
            ans = 0
            break
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
aaa = list(map(int, input().split()))
aaa.sort()
mod = 10 ** 9 + 7
ans = int(2 ** (n / 2) % mod) if n % 2 == 0 else int(2 ** ((n - 1) / 2) % mod)
if n % 2 == 0:
    for i in range(0, n, 2):
        if aaa[i] != aaa[i + 1]:
            ans = 0
            break
else:
    for i in range(1, n, 2):
        if aaa[i] != aaa[i + 1]:
            ans = 0
            break
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
aaa = list(map(int, input().split()))
aaa.sort()
mod = 10 ** 9 + 7
ans = int(2 ** (n / 2) % mod) if n % 2 == 0 else int(2 ** ((n - 1) / 2) % mod)
if n % 2 == 0:
    for i in range(0, n, 2):
        if aaa[i] != aaa[i + 1]:
            ans = 0
            break
else:
    for i in range(1, n - 1, 2):
        if aaa[i] != aaa[i + 1]:
            ans = 0
            break
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
aaa = list(map(int, input().split()))
aaa.sort()
mod = 10 ** 9 + 7
ans = int(2 ** (n / 2) % mod) if n % 2 == 0 else int(2 ** ((n - 1) / 2) % mod)
if n % 2 == 0:
    for i in range(0, n, 2):
        if aaa[i] != aaa[i + 1]:
            ans = 0
            break
else:
    for i in range(1, n - 1, 2):
        if aaa[i] != aaa[i + 1]:
            ans = 0
            break
print(ans)
Problem p03943 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b == c or b + c == a or c + a == b:
    print('Yes')
else:
    prtnt('No')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b = c or b + c = a or c + a = b:
    print('Yes')
else:
    prtnt('No')
Problem p04029 (python)

Fixed submission:
n = int(input())
ans = 0
for i in range(1, n+1):
    ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1, n+1)
    ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1, n)
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1, n+1)
    ans += 1
print(ans)