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

Fixed submission:
L, R = map(lambda x: int(x),input().split(" "))
num_list = []

while L > 2019:
  L = int(L-2019)
  R = int(R-2019)

if R < 2019:
  for i in range(L,R):
    for j in range(L+1,R+1):
      num_list.append((i*j)%2019)
  print(min(num_list))
elif L <= 2019 and R >= 2019:
  print(0)

Buggy submission (verdict: Runtime Error):
L, R = map(lambda x: int(x),input().split(" "))
num_list = []

while L > 2019:
  L = int(L%2019)
  R = int(R%2019)

if R < 2019:
  for i in range(L,R):
    for j in range(L+1,R+1):
      num_list.append((i*j)%2019)
  print(min(num_list))
elif L <= 2019 and R >= 2019:
  print(0)
Problem p02923 (python)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
counter = 0
ans = []
for i in range(n-1):
    if h[i] >= h[i+1]:
        counter +=1
    else:
        ans.append(counter)
        counter = 0
ans.append(counter)
print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
counter = 0
ans = []
for i in range(n-1):
    if h[i] >= h[i+1]:
        counter +=1
    else:
        ans.append(counter)
        counter = 0

print(max(ans,counter))
Problem p02924 (python)

Fixed submission:
n = int(input())
print((n-1) * n // 2 )

Buggy submission (verdict: Runtime Error):
n = int(input())
print(sum(list(range(n))))
Problem p02934 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
import numpy as np
npa = np.array(a)
print(1/(sum(1/npa)))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
import numpy as np
npa = np.array(a)
print(1/(sum(1/a)))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
import numpy as np
npa = np.array(a)
print(1/(sum(1/a))
Problem p02947 (python)

Fixed submission:
n=int(input())
s = [ str(input()) for _ in range(n)]
s = sorted([sorted(x) for x in s])
pairs = 0
from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

i=0
while i < n-1:
    sames = 0
    for j in range(i+1, n):
        if s[i] == s[j]:
            sames += 1
            continue
        else:
            break
    i += sames + 1
    if sames != 0:
        pairs += combinations_count(sames + 1, 2)


print(int(pairs))

Buggy submission (verdict: Runtime Error):
n=int(input())
s = [ str(input()) for _ in range(n)]
s = sorted([sorted(x) for x in s])
pairs = 0
from math import factorial
# for i in range(n):
#     for j in range(i+1, n):
#         if s[i] == s[j]:
#             pairs.append(tuple([i,j]))
def comb(n, r):
    return (factorial(n) / factorial(r) / factorial(n - r))

i=0
while i < n-1:
    sames = 0
    for j in range(i+1, n):
        if s[i] == s[j]:
            sames += 1
            continue
        else:
            break
    i += sames + 1
    if sames != 0:
        pairs += comb(sames + 1, 2)

print(int(pairs))
Problem p02958 (python)

Fixed submission:
n=int(input())
p=list(map(int, input().split()))
ans=list(range(1,n+1))

ans_mix=[]
is_possible = False

if p==ans:
    is_possible = True

for i in range(0, n-1):
    for j in range(1, n):
        a=ans.copy()
        tmp=a[i]
        a[i]=a[j]
        a[j]=tmp
        if a==p:
            is_possible = True

if is_possible:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
n=int(input())
p=list(map(int, input().split()))
ans=list(range(n) + 1)

ans_mix=[]
is_possible = False

if p==ans:
    is_possible = True

for i in range(0, n-1):
    for j in range(1, n):
        a=ans.copy()
        tmp=a[i]
        a[i]=a[j]
        a[j]=tmp
        if a==p:
            is_possible = True

if is_possible:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
n=int(input())
p=list(map(int, input().split()))
ans=list(range(N) + 1)

ans_mix=[]
is_possible = False
for i in range(0, n-1):
    for j in range(1, n):
        a=ans.copy()
        tmp=a[i]
        a[i]=a[j]
        a[j]=tmp
        if a==p:
            is_possible = True
            
if is_possible:
    print('YES')
else:
    print('NO')
Problem p02988 (python)

Fixed submission:

n = int(input())
p = list(map(int,input().split()))
print(sum([max(p[i+1],p[i],p[i-1]) != p[i] and min(p[i+1],p[i],p[i-1]) != p[i] for i in range(1,n-1)]))

Buggy submission (verdict: Runtime Error):
n,*p=[int(t.split())for t in open(0)]
print(sum([(p[i+1]-p[i])*(p[i]-p[i-1]) < 0 for i in range(1,n)]))
Problem p02993 (python)

Fixed submission:
s=list(str(input()))
print('Bad' if s[0]==s[1] or s[1]==s[2] or s[2]==s[3] else 'Good')

Buggy submission (verdict: Runtime Error):
s=list(str(int(input())))
print('Bad' if s[0]==s[1] or s[1]==s[2] or s[2]==s[3] else 'Good')
Problem p02921 (python)

Fixed submission:
S = input()
T = input()

ans = 0
if S[0:1] == T[0:1]:
    ans +=1

if S[1:2] == T[1:2]:
    ans +=1

if S[2:3] == T[2:3]:
    ans +=1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
x = [0] * N
y = [0] * N
for i in range(N):
    x[i], y[i] = map(int, input().split())
A = 0
B = 0
ans = 0
pre_ans = 0
for i in range(N):
    if x[i]>=0 and y[i]>=0:
        A+=x[i]
        B+=y[i]
    elif x[i]*y[i]<0 and x[i]+y[i]>0:
        A+=x[i]
        B+=y[i]
ans = (A**2+B**2)**0.5

A = 0
B = 0
for i in range(N):
    if x[i]>=0 and y[i]<=0:
        A+=x[i]
        B+=y[i]
    elif x[i]*y[i]>0 and x[i]-y[i]>0:
        A+=x[i]
        B+=y[i]
pre_ans = (A**2+B**2)**0.5
if pre_ans > ans:
    ans = pre_ans

A = 0
B = 0
for i in range(N):
    if x[i]<=0 and y[i]<=0:
        A+=x[i]
        B+=y[i]
    elif x[i]*y[i]<0 and x[i]+y[i]<0:
        A+=x[i]
        B+=y[i]
pre_ans = (A**2+B**2)**0.5
if pre_ans > ans:
    ans = pre_ans

A = 0
B = 0
for i in range(N):
    if x[i]<=0 and y[i]>=0:
        A+=x[i]
        B+=y[i]
    elif x[i]*y[i]>0 and -x[i]+y[i]>0:
        A+=x[i]
        B+=y[i]
pre_ans = (A**2+B**2)**0.5
if pre_ans > ans:
    ans = pre_ans





print(ans)
Problem p03662 (python)

Fixed submission:
import sys
from collections import deque

cin = sys.stdin
# cin = open("in.txt", "r")

def line2N():
    return map(int, cin.readline().split())


N, = line2N()
adj = [[] for i in range(N+1)]
for i in range(N-1):
    u, v = line2N()
    adj[u].append(v)
    adj[v].append(u)

color = [0]*(N+1)
h_cnt = 1
t_cnt = 1
dq_head = deque([1])
color[1] = 1
dq_tail = deque([N])
color[N] = 1
for step in range(N):
    if step % 2==0:
        if not dq_head:
            t_cnt = N - h_cnt
            break
        dq_head_n = deque()
        for u in dq_head:
            for v in adj[u]:
                if color[v]==0:
                    color[v] = 1
                    dq_head_n.append(v)
                    h_cnt += 1
        dq_head = dq_head_n

    else:
        if not dq_tail:
            h_cnt = N - t_cnt
            break
        dq_tail_n = deque()
        for u in dq_tail:
            for v in adj[u]:
                if color[v]==0:
                    color[v] = 2
                    dq_tail_n.append(v)
                    t_cnt += 1
        dq_tail = dq_tail_n

# print(h_cnt, t_cnt)
if h_cnt > t_cnt:
    print("Fennec")
else:
    print("Snuke")

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

cin = sys.stdin
# cin = open("in.txt", "r")

def line2N():
    return map(int, cin.readline().split())


N, = line2N()
adj = [[] for i in range(N+1)]
for i in range(N-1):
    u, v = line2N()
    adj[u].append(v)
    adj[v].append(u)

color = [0]*(N+1)
h_cnt = 1
t_cnt = 1
dq_head = deque([1])
dq_head.append(2)
dq_tail = deque([N])
for step in range(N):
    if step % 2==0:
        u = dq_head.popleft()
        for v in adj[u]:
            if color[v]==0:
                color[v] = 1
                dq_head.append(v)
                h_cnt += 1
    else:
        u = dq_tail.popleft()
        for v in adj[u]:
            if color[v]==0:
                color[v] = 2
                dq_tail.append(v)
                t_cnt += 1

if h_cnt>t_cnt:
    print("Fennec")
else:
    print("Snuke")
Problem p03817 (python)

Fixed submission:
import sys

cin = sys.stdin

x = int(cin.readline())
c = x//11
cnt = c*2
r = x%11
# print(r)
if r>0:
    cnt +=1
    if r>6:
        cnt +=1

print(cnt)

Buggy submission (verdict: Runtime Error):
import sys

cin = sys.stdin
cin = open("in.txt", "r")

x = int(cin.readline())
c = x//11
cnt = c*2
r = x%11
# print(r)
if r>0:
    cnt +=1
    if r>6:
        cnt +=1

print(cnt)
Problem p03848 (python)

Fixed submission:
import sys

cin = sys.stdin
#cin = open("in.txt", "r")

MODULO = int(10**9+7)
N = int(cin.readline())
A = list(map(int, cin.readline().split()))
pos = [0]*(N+1)
if (N%2==1):
    pos[0]=1
for ai in A:
    if (ai+N)%2==0 or ai>=N or ai<0:
        print(0)
        exit()
    pos[ai]+=1
    if pos[ai]>2:
        print(0)
        exit()
cnt = 1
for i in range(N//2):
    cnt = cnt * 2 % MODULO
print(cnt)

Buggy submission (verdict: Runtime Error):
import sys

cin = sys.stdin
cin = open("in.txt", "r")

MODULO = int(10**9+7)
N = int(cin.readline())
A = list(map(int, cin.readline().split()))
pos = [0]*(N)
if (N%2==1):
    pos[N//2+1]=1
for ai in A:
    if (ai+N)%2==0:
        print(0)
        exit()
    pos[ai]+=1
    if pos[ai]>2:
        print(0)
        exit()
cnt = 1
for i in range(N//2):
    cnt = cnt * 2 % MODULO
print(cnt)
Problem p02909 (python)

Fixed submission:
s = input()

if s == "Sunny":
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

Buggy submission (verdict: Runtime Error):
n, k, q = list(map(int, input().split()))
a = [0] * q
for i in range(q):
  a[i] = int(input())

cur_k = [k] * n

for i in range(q):
  cur_k[a[i] - 1] += 1

for i in cur_k:
  if (i > q):
    print("Yes")
  else:
    print("No")
Problem p02923 (python)

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

cnt = 0
ansers = []

for i in range(len(h)-1):
  if h[i] >= h[i+1]:
    cnt += 1
  else:
    ansers.append(cnt)
    cnt = 0
else:
  ansers.append(cnt)

print(max(ansers))

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

cnt = 0
ansers = []

for i in range(len(h)-1):
  if h[i] >= h[i+1]:
    cnt += 1
  else:
    cnt = 0
  ansers.append(cnt)

print(max(ansers))

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

cnt = 0
ansers = []

for i in range(len(h)-1):
  if h[i] >= h[i+1]:
    cnt += 1
  else:
    ansers.append(cnt)
    cnt = 0
  ansers.append(cnt)

print(max(ansers))
Problem p02910 (python)

Fixed submission:
S = input()
if S[0::2].count("L") + S[1::2].count("R") == 0: print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
S = input()
if S[0::2].count("L") + S[1::2].count("R") == 0: print("Yes")
  else: print("No")

Buggy submission (verdict: Runtime Error):
S = input()
if S[0::2].count("L") + S[1::2].count("R") = 0: print("Yes")
  else: print("No")
Problem p02923 (python)

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

count = 0
max_count = 0
for i in range(n-1):
  if h[i]>=h[i+1]:
    count += 1
  else: count = 0
  
  if count > max_count: max_count = count
print(max_count)

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

count
max_count = 0
for i in range(n-1):
  if h[i]>=h[i+1]:
    count += 1
  else: count = 0
  
  if count > max_count: max_count = count
print(max_count)

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

count
max_count = 0
for i in range(n-1):
  if h[i]>=h[i+1]:
    count += 1
  else: count = 0
  
  if count > max_count: max_count = count
print(max_count)
Problem p03760 (python)

Fixed submission:
a=list(input())
b=list(input())+[""]
for x,y in zip(a,b):
    print(x+y, end="")

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
m=""
for i in range(len(a)):
    m=m+a[i]+b[i]
    i +=1
print(m)
Problem p02909 (python)

Fixed submission:
S = input()
weather_dic = {'Sunny': 'Cloudy', 'Cloudy': 'Rainy', 'Rainy': 'Sunny'}
print(weather_dic[S])

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
 
 
N, K, Q = map(int, input().split(' '))
a = [int(input()) for _ in range(Q)]
 
num_ans = defaultdict(int)
for i in a:
    num_ans[i-1] += 1
 
for i in range(N):
    win = K - (Q - num_ans[i]) > 0
    print('Yes' if win else 'No')

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


N, K, Q = list(map(int, input().split(' ')))
a = [int(input()) for _ in range(N)]

num_ans = defaultdict(int)
for i in a:
    num_ans[i-1] += 1

for i in range(N):
    win = K - (Q - num_ans[i]) > 0
    print('Yes' if win else 'No')
Problem p02911 (python)

Fixed submission:
from collections import defaultdict

N, K, Q = map(int, input().split(' '))
a = [int(input()) for _ in range(Q)]

num_ans = defaultdict(int)
for i in a:
    num_ans[i-1] += 1

for i in range(N):
    win = K - (Q - num_ans[i]) > 0
    print('Yes' if win else 'No')

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


N, K, Q = list(map(int, input().split()))
a = [int(input()) for _ in range(N)]

num_ans = defaultdict(int)
for i in a:
    num_ans[i-1] += 1

for i in range(N):
    win = K - (Q - num_ans[i]) > 0
    print('Yes' if win else 'No')
Problem p03471 (python)

Fixed submission:
n, y = [int(x) for x in input().split(' ')]
q, mod = divmod(y, 10000)

if n * 10000 > y and y > (n-1)* 10000 + 5000:
	print('-1 -1 -1')
else:
	if q == n and mod == 0:
		print('{} 0 0'.format(q))
	else:
		for a in range(q+1):
			b = int((y - 1000 * n - 9000 * a) / 4000)
			c = int((5000 * n - y + 5000 * a) / 4000)
			if a + b + c == n and a >= 0 and b >= 0 and c >= 0 and 10000 * a + 5000 * b + 1000 * c == y:
				print('{} {} {}'.format(a, b, c))
				break
		else:
			print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
n, y = map(int, input().split(' '))
yy = y // 1000
d = yy - n
a = (4 * d - n - 3 * yy) / 5
b = (8 * yy - 9 * d + n) / 5
if a>= 0 and b >= 0 and c >= 0:
	print(a, b, c)
else:
	print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
n, y = map(int, input().split(' '))
yy = y / 1000
d = yy - n
a = (4 * d - n - 3 * yy) / 5
b = (8 * yy - 9 * d + n) / 5
if a>= 0 and b >= 0 and c >= 0:
	print(a, b, c)
else:
	print('-1 -1 -1')
Problem p02909 (python)

Fixed submission:
now_wether = input() 

if now_wether == "Sunny":
  print("Cloudy")
elif now_wether == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

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

if now_wether == "Sunny":
  print(Cloudy)
elif now_wether == "Cloudy":
  print(Rainy)
else:
  print(Sunny)
Problem p02921 (python)

Fixed submission:
S = input()
T = input()

ans = 0

for i in range(3):
    if (S[i] == T[i]):
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = 0
start = 0

while ( start < N ):
    tmp_ans = 0
    for j in range(start, N-1):
        if (H[j] >= H[j+1]):
            tmp_ans += 1
        else:
            start += tmp_ans
            break
            
    ans = max(ans, tmp_ans)
    start += 1
    
print(ans)
Problem p03162 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10000000)
 
N = int(input())
H = list(list(map(int,input().split())) for _ in range(N))
#sub problem: max cost from 0 to ith day
memo = {}
def rec(i, choice):
  if (i, choice) in memo:
    return memo[(i, choice)]
  if i == len(H):
    return 0
  m = max(H[i][j] + rec(i+1,j) for j in range(3) if j != choice)
  memo[(i, choice)] = m
  return m
print(max(rec(0, j) for j in range(3)))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000000)
 
N = int(input())
H = list(list(map(int,input().split())) for _ in range(N))
#sub problem: max cost from 0 to ith day
memo = {}
def rec(i, choice):
  if memo[(i, choice)]:
    return memo[(i,choice)]
  if i == len(H):
    return 0
  m = max(H[i][j] + rec(i+1,j) for j in range(3) if j != choice)
  memo[(i, choice)] = m
  return m
print(max(rec(0, j) for j in range(3)))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000000000)

N = int(input())
H = list(list(map(int,input().split())) for _ in range(N))
#sub problem: max cost from 0 to ith day
def rec(i, choice):
  if i == len(H):
    return 0
  return max(H[i][j] + rec(i+1,j) for j in range(3) if j != choice)
print(max(rec(0, j) for j in range(3)))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(list(map(int,input().split())) for _ in range(N))
#sub problem: max cost from 0 to ith day
def rec(i, choice):
  if i == len(H):
    return 0
  return max(H[i][j] + rec(i+1,j) for j in range(3) if j != choice)
print(max(rec(0, j) for j in range(3)))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(list(map(int,input().split())) for _ in range(N))
#sub problem: max cost from 0 to ith day
def rec(i, choice):
  if i == len(H):
    return 0
  return max((H[i][j] + rec(i+1,j) for j in range(3) if j != choice), default=0)
print(max((rec(0, j) for j in range(3)), default=0))

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

H = list(list(map(int,input().split())) for _ in range(N))

#sub problem: max cost from 0 to ith day
def rec(i, choice):
  if i == len(H):
    return 0
  m = max(H[i][j] + rec(i+1,j) for j in range(3) if j != choice)
  print(m)
  return m
print(max(rec(0, j) for j in range(3)))

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

H = list(list(map(int,input().split())) for _ in range(N))

#sub problem: max cost from 0 to ith day
def rec(i, choice):
  if i == len(H):
    return 0
  return max(H[i][j] + rec(i+1,j) for j in range(3) if j != choice)
print(max(rec(0, j) for j in range(3)))

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

H = list(list(map(int,input().split())) for _ in range(N))

#sub problem: min cost from 0 to i
def rec(i, choice):
  if i == len(H):
    return 0
  return max(H[i][j] + rec(i+1,j) for j in range(3) if j != choice)
print(max(rec(0, j) for j in range(3)))
Problem p03605 (python)

Fixed submission:
N = input()
result = "No"
for i in N:
    if i == '9':
        result = "Yes"
print(result)

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

b = list()
lenB = 0
for a in A:
    b.append(a)
    lenB += 1
    if len(set(b)) != lenB:
        b.pop(-1)
        b.remove(a)
        lenB -= 2
print(len(b))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = [int(input()) for i in range(n)] 
 
counter = [0]*max(A)
cnt = 0
for a in A:
    counter[a-1] += 1
for c in counter:
    if c % 2 == 0 & c != 0:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):

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


t = set()
B = [x for x in A if x in t or t.add(x)]


C = [item for item in A if item not in B]
print(len(C))

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

B = set(A)

C = [item for item in A if item not in B]
print(len(C))

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

counter = [0] * 1000000000
cnt = 0
for a in A:
    counter[a-1] += 1
for c in counter:
    if c == 1:
        cnt += 1
print(cnt)

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

counter = [0]*n
cnt = 0
for a in A:
    counter[a-1] += 1
for c in counter:
    if c == 1:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = input()
result = "NO"
if i in N:
    if i == '9':
        result = "YES"
print(result)

Buggy submission (verdict: Runtime Error):
N = [int(i) for i in input().split()]
result = "NO"
if i in N:
    if i == 9:
        result = "YES"
print(result)
Problem p03607 (python)

Fixed submission:
n = int(input())
A = [int(input()) for i in range(n)]

b = set()
lenB = 0
for a in A:
    b.add(a)
    lenB += 1
    if len(b) != lenB:
        b.remove(a)
        lenB -= 2
print(len(b))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = [int(input()) for i in range(n)]
 
B = set()
lenB = 0
for a in A:
    if a in B:
        B.remove(a)
        lenB -= 1
    else:
        b.add(a)
        lenB += 1
print(lenB)

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

b = list()
for a in A:
    b.add(a)
    if len(set(b)) != len(b):
        b.pop(-1)
        b.remove(a)
print(len(b))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = [int(input()) for i in range(n)] 
 
counter = [0]*max(A)
cnt = 0
for a in A:
    counter[a-1] += 1
for c in counter:
    if c % 2 == 0 & c != 0:
        cnt += 1
print(cnt)

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

counter = [0]*1000000000
cnt = 0
for a in A:
    counter[a-1] += 1
for c in counter:
    if c % 2 == 0 & c != 0:
        cnt += 1
print(cnt)
Problem p03657 (python)

Fixed submission:
A, B = map(int, input().split())
print("Possible" if ((A) % 3 == 0 or (B) % 3 == 0 or (A + B) % 3 == 0) else "Impossible")

Buggy submission (verdict: Runtime Error):
N = int(input())
I = list(map(int, input().split()))
minX = 10000000000
start = 0
for i in range(1, len(I)):
  start += I[i-1]
  minX = min(minX, abs(start - sum(I[-i:]) ) )
  
print(minX)

Buggy submission (verdict: Runtime Error):
N = int(input())
I = list(map(int, input().split()))
minX = 1000000
for i in range(1, len(I)):
  minX = min(minX, abs(sum(I[:-i]) - sum(I[-i:]) ) )
  
  
print(minX)
Problem p03659 (python)

Fixed submission:
N = int(input())
I = list(map(int, input().split()))
minX = 10000000000
end = I.pop()
sumI = sum(I)
for i in range(len(I)):
  minX = min(minX, abs(sumI - end ) )
  popped = I.pop()
  sumI -= popped
  end += popped
  
print(minX)

Buggy submission (verdict: Runtime Error):
N = int(input())
I = map(int, input().split())
minX = 1000000
for i in range(len(I)):
  minX = min(minX, abs(sum(I[:-i]) - sum(I[-i:]) ) )
  
print(minX)

Buggy submission (verdict: Runtime Error):
 int(input())
I = sorted(map(int, input().split()))
minX = 1000000
for i in range(len(I)):
  minX = min(minX, abs(sum(I[:-i]) - sum(I[-i:]) ) )
  
print(minX)

Buggy submission (verdict: Runtime Error):
K = int(input())
I = sorted(map(int, input().split()))
minX = 1000000
for i in range(I):
  minX = min(minX, abs(sum(I[:-i]) - sum(I[-i:]) ) )
  
print(minX)
Problem p03712 (python)

Fixed submission:
H, W = map(int, input().split())
array = list()
header = ""
for i in range(0, H):
    array.append("#" + input() + "#")
for i in range(0, W + 2):
    header += "#"

print(header)
for p in array:
    print(p)
print(header)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
array = list()
header = ""
for i in range(0, H):
    array[i] = "#" + input() + "#"
for i in range(0, W+2):
    header += "#"
    
print(header)
for p in array:
    print(p)
print(header)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
array = list()
header = ""
for i in range(H):
    array[i] = "#" + input() + "#"
for i in range(0, W+2):
    header += "#"
    
print(header)
for p in array:
    print(p)
print(header)

Buggy submission (verdict: Runtime Error):
H, W = input().split()
array = list()
header = ""
for i in range(H):
    array[i] = "#" + input() + "#"
for i in range(0, W+2):
    header += "#"
    
print(header)
for p in array:
    print(p)
print(header)
Problem p03729 (python)

Fixed submission:
a, b, c = 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(int, input().split())

result = "NO"
for i in range(1, 100):
    if a * i % b == c:
        result = "YES"
print(result)
Problem p03813 (python)

Fixed submission:
x = int(input())

if x < 1200:
    print("ABC")
else:
    print("ARC")

Buggy submission (verdict: Runtime Error):
N = input()
A = input()
print(int(N)-2)

Buggy submission (verdict: Runtime Error):
N = input()
A = input()
print(len(set(A.split())))

Buggy submission (verdict: Runtime Error):
if x < 1200:
  print("ABC")
else:
  print("ARC")