Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N,Q=[int(i) for i in input().split()]
S=input()
lr=[]
for i in range(Q):
  lr.append(tuple(int(i) for i in input().split()))

def AC(l,r):
  count=0
  ss=S[l-1:r]
  for i in range(len(ss)-1):
    if ss[i]+ss[i+1]=="AC":
      count+=1
  return count

for i in range(Q):
  print(AC(lr[i][0],lr[i][1]))

Fixed submission:
N,Q=[int(i) for i in input().split()]
S=input()
lr=[]
for i in range(Q):
  lr.append([int(i) for i in input().split()])

acn=[0 for i in range(N)]
count=0
for i in range(1,N):
  if S[i-1]+S[i]=="AC":
    count+=1
  acn[i]=count
for i in range(Q):
  l=lr[i][0]
  r=lr[i][1]
  print(acn[r-1]-acn[l-1])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,M=[int(i) for i in input().split()]
a=[]
for j in range(N):
  a.append([int(i) for i in input().split()])
a.sort(key=lambda x:x[0])

cost=0
for j in range(M):
  if a[0][1]==0:
    a.pop(0)
  if a[0][1]>=1:
    a[0][1]-=1
    cost+=a[0][0]
print(cost)

Fixed submission:
import numpy as np
N,M=[int(i) for i in input().split()]
a=[]
for j in range(N):
  a.append([int(i) for i in input().split()])
 
a.sort(key=lambda x:x[0])
 
cost=0
shop=0
for j in range(M):
  if a[shop][1]==0:
    shop+=1
  a[shop][1]-=1
  cost+=a[shop][0]
print(cost)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,M=[int(i) for i in input().split()]
a=[]
for j in range(N):
  a.append([int(i) for i in input().split()])
a.sort(key=lambda x:x[0])

cost=0
for j in range(M):
  if a[0][1]==0:
    a.pop(0)
  if a[0][1]>=1:
    a[0][1]-=1
    cost+=a[0][0]
print(cost)

Fixed submission:
import numpy as np
N,M=[int(i) for i in input().split()]
a=[]
for j in range(N):
  a.append([int(i) for i in input().split()])
 
a.sort(key=lambda x:x[0])
 
cost=0
shop=0
for j in range(M):
  if a[shop][1]==0:
    shop+=1
  a[shop][1]-=1
  cost+=a[shop][0]
print(cost)
Buggy python submission (verdict: Runtime Error):
A,B,K=[int(i) for i in input().split()]
a=[]
for i in range(1,max(A,B)):
  if A%i==0 and B%i==0:
    a.append(i)
print(a[-k])
  

Fixed submission:
A,B,K=[int(i) for i in input().split()]
a=[]
for i in range(1,max(A,B)+1):
  if A%i==0 and B%i==0:
    a.append(i)
print(a[-K])
Buggy python submission (verdict: Runtime Error):
N,M=[int(i) for i in input().split()]
bridge=[]
for i in range(M):
  bridge.append([int(i)-1 for i in input().split()])
nod=[[i,[i]] for i in range(N)]
e=0
totale=int(N*(N-1)/2)


def joint(a,b,e):
  na=nod[a][0]
  nb=nod[b][0]
  if na==nb:
    return e
  else:
    e+=len(nod[na][1])*len(nod[nb][1])
    if na<=nb:
      nod[na][1].extend(nod[nb][1])
      for i in nod[nb][1]:
        nod[i][0]=na
      nod[nb][1]=0
    else:
      nod[nb][1].extend(nod[na][1])
      for i in nod[na][1]:
        nod[i][0]=na
      nod[na][1]=0
    return e
  


ans=[]
for i in range(M-1,-1,-1):
  ans.append(totale-e)
  e=joint(bridge[i][0],bridge[i][1],e)
  
for i in range(M-1,-1,-1):
  print(ans[i])

Fixed submission:
N,M=[int(i) for i in input().split()]
bridge=[]
for i in range(M):
  bridge.append([int(i)-1 for i in input().split()])
nod=[[i,[i]] for i in range(N)]
e=0
totale=int(N*(N-1)/2)


def joint(a,b,e):
  na=nod[a][0]
  nb=nod[b][0]
  if na==nb:
    return e
  else:
    e+=len(nod[na][1])*len(nod[nb][1])
    if na<nb:
      nod[na][1].extend(nod[nb][1])
      for i in nod[nb][1]:
        nod[i][0]=na
    else:
      nod[nb][1].extend(nod[na][1])
      for i in nod[na][1]:
        nod[i][0]=nb
    return e
  


ans=[]
for i in range(M-1,-1,-1):
  ans.append(totale-e)
  e=joint(bridge[i][0],bridge[i][1],e)
  
for i in range(M-1,-1,-1):
  print(ans[i])
Buggy python submission (verdict: Runtime Error):
N,M=[int(i) for i in input().split()]
buf=[0]*M
for i in range(N):
  a=[int(i) for i in input().split()]
  for j in a[1:]:
    buf[j]+=1
c=0
for i in buf:
  if i==N:
    c+=1
print(c)

Fixed submission:
N,M=[int(i) for i in input().split()]
buf=[0]*M
for i in range(N):
  a=[int(i) for i in input().split()]
  for j in a[1:]:
    buf[j-1]+=1
c=0
for i in buf:
  if i==N:
    c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
N,M=[int(i) for i in input().split()]
X=[int(i) for i in input().split()]
X.sort()
rui=[]
for i in range(len(X)-1):
  rui.append(X[i+1]-X[i])
rui.sort()
print(sum(rui[0:-(N-1)]))N,M=[int(i) for i in input().split()]
X=[int(i) for i in input().split()]
X.sort()
rui=[]
for i in range(len(X)-1):
  rui.append(X[i+1]-X[i])
rui.sort()
print(sum(rui[0:-(N-1)]))

Fixed submission:
N,M=[int(i) for i in input().split()]
X=[int(i) for i in input().split()]
X.sort()
rui=[]
for i in range(len(X)-1):
  rui.append(X[i+1]-X[i])
rui.sort()
if N==1:
  print(sum(rui))
elif M>=N:
  print(sum(rui[0:-(N-1)]))
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
w=input()
def solve():
  for j in [chr(i) for i in range(91,91+26)]
    if w.count(j)%2==0:
      print("No")
      return
  print("Yes")
  return

solve()

Fixed submission:
w=input()
def solve():
  for j in [chr(i) for i in range(91,91+26)]:
    if w.count(j)%2!=0:
      print("No")
      return
  print("Yes")
  return

solve()
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[]
B=[]
for i in range(N):
	if i%2==0:
		A.append(int(input()))
	else:
		B.append(int(input()))
		
A=sorted(A)
B=sorted(B)
C=sorted(A+B)
#ここまでNlogN
c=0
j=0
for i in range(C):
	if A[j]==C[i]:
		if i%2==1:
			c+=1
		j+=1
print(c)

Fixed submission:
N=int(input())
A=[]
B=[]
for i in range(N):
	if i%2==0:
		A.append(int(input()))
	else:
		B.append(int(input()))
		
A=sorted(A)
B=sorted(B)
C=sorted(A+B)
#ここまでNlogN
c=0
j=0
for i in range(N):
	if j>=len(A):
		break
	if A[j]==C[i]:
		if i%2==1:
			c+=1
		j+=1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
B=[]
for i in range(N):
	if i%2==0:
		A.append(int(input()))
	else:
		B.append(int(input()))
		
A=sorted(A)
B=sorted(B)
C=sorted(A+B)
#ここまでNlogN
c=0
for a in A:
	if C.index(a)%2==1:
		c+=1
print(c)

Fixed submission:
N=int(input())
A=[]
B=[]
for i in range(N):
	if i%2==0:
		A.append(int(input()))
	else:
		B.append(int(input()))
		
A=sorted(A)
B=sorted(B)
C=sorted(A+B)
#ここまでNlogN
c=0
j=0
for i in range(N):
	if j>=len(A):
		break
	if A[j]==C[i]:
		if i%2==1:
			c+=1
		j+=1
print(c)
Buggy python submission (verdict: Runtime Error):
a = int(input())
print (ans = 3*a*a)

Fixed submission:
a = int(input())
print(a*a*3)
Buggy python submission (verdict: Runtime Error):
import math
N,D = map(int,input().split)
print(N/(D*2+1))

Fixed submission:
import math
N,D = map(int,input().split())
print(math.ceil(N/(D*2+1)))
Buggy python submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())
bc = B // C
bd = B // D
ac = (A - 1) // C
ad = (A - 1) // D
def lcm(C, D):
    return (C * D) // math.gcd(C, D)
bcd = B // lcm(C, D)
acd = (A - 1) // lcm(C, D)
a = bc - ac
b = bd - ad
c = bcd - acd
print((B + 1 - A) - (a + b - c))

Fixed submission:
A, B, C, D = map(int, input().split())
bc = B // C
bd = B // D
ac = (A - 1) // C
ad = (A - 1) // D
def gcd(C, D):
    while D:
        C, D = D, C % D
    return C
def lcm(C, D):
    return C * D // gcd(C, D)
bcd = B // lcm(C, D)
acd = (A - 1) // lcm(C, D)
a = bc - ac
b = bd - ad
c = bcd - acd
print((B + 1 - A) - (a + b - c))
Buggy python submission (verdict: Runtime Error):
# A = int(input())
# B = int(input())
# C = int(input())
# D = int(input())
# E = int(input())
M = [int(input()) for _ in range(5)]
m = []
T = 0
for i in range(5):
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        m.append(M[i] % 10)
print(T - (10 - min(m)))


Fixed submission:
M = [int(input()) for _ in range(5)]
m = []
T = 0
for i in range(5):
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        m.append(M[i] % 10)
print(T - (10 - (10 if not m else min(m))))

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
M = [A, B, C, D, E]
n = []
T = 0
for i in range(5):
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        n.append(M[i] % 10)
print(T - (10 - min(n)))

Fixed submission:
M = [int(input()) for _ in range(5)]
m = []
T = 0
for i in range(5):
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        m.append(M[i] % 10)
print(T - (10 - (10 if not m else min(m))))

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
M = [A, B, C, D, E]
N = []
n = []
T = 0
for i in range(5):
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        n.append(M[i] % 10)
print(T - (10 - min(n)))

Fixed submission:
M = [int(input()) for _ in range(5)]
m = []
T = 0
for i in range(5):
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        m.append(M[i] % 10)
print(T - (10 - (10 if not m else min(m))))
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
S = []
for i in range(50):
    if A % (i + 1) == 0 and B % (i + 1) == 0:
        S.append(i + 1)
print(S[-K])

Fixed submission:
A,B,K = map(int,input().split())
S = []
for i in range(100):
    if A % (i + 1) == 0 and B % (i + 1) == 0:
        S.append(i + 1)
print(S[-K])
Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())
a = 0
while True:
    if "0" in S and "1" in S:
        S.pop(S.index("0"))
        S.pop(S.index("1"))
        a += 2
    else:
        break
print(a)

Fixed submission:
S = list(input())
a = S.count("0")
b = S.count("1")
if a == b:
    print(a * 2)
elif a > b:
    print(b * 2)
elif a < b:
    print(a * 2)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())


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


print(lcm(2, N))

Fixed submission:
N = int(input())
if N % 2 == 0:
    print(N)
else:
    print(2 * N)

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(2, N))

Fixed submission:
N = int(input())
if N % 2 == 0:
    print(N)
else:
    print(2 * N)
Buggy python submission (verdict: Runtime Error):
r = input()
result = 3*r*r
print(result)

Fixed submission:
r = int(input())
result = 3*r*r
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = list(map(int,input().split()))

for i,j in zip(x,range(n)):
    x.remove(i)
    t = sorted(x)
    print(t[int(n/2-1)])
    x.insert(j,i)

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

s = sorted(x)
u = s[int(n/2)]
t =s[int(n/2-1)]

for i in (x):
    if i < u:
        print(u)
    else:
        print(t)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = list(map(int,input().split()))

for i,j in zip(x,range(n)):
    x.remove(i)
    t = sorted(x)
    print(t[int(n/2-1)])
    x.insert(j,i)

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

s = sorted(x)
u = s[int(n/2)]
t =s[int(n/2-1)]

for i in (x):
    if i < u:
        print(u)
    else:
        print(t)

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
s = sum(x)

for i,j in zip(x,range(n)):
    x.remove(i)
    t = sorted(x)
    print(t)
    print(t[int(n/2-1)])
    x.insert(j,i)
    print(x)

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

s = sorted(x)
u = s[int(n/2)]
t =s[int(n/2-1)]

for i in (x):
    if i < u:
        print(u)
    else:
        print(t)
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for j in range(M)]

count = 0
for word in (s):
    counter = max(counter,s.count(word) - t.count(word))
print(counter)

Fixed submission:
n = int(input())
s = list()
counter = 0

for i in range(n):
    s.append(input())
    
m = int(input())
t = list()

for i in range(m):
    t.append(input())

for word in s:
    counter = max(counter,s.count(word) -t.count(word))
print(counter)
Buggy python submission (verdict: Runtime Error):
mod0 = []
lst = []
for i in range(5):
    inp = int(input())
    if inp % 10 == 0:
        mod0.append(inp)
    else:
        lst.append([inp, inp % 10])
ans = sum(mod0)
lst.sort(key= lambda x :x[1])
last = lst.pop(0)
ans = sum(mod0)
for i,imod in lst:
    ans += (i//10 +1)*10

ans+=last[0]
print(ans)


Fixed submission:
mod0 = []
lst = []
for i in range(5):
    inp = int(input())
    if inp % 10 == 0:
        mod0.append(inp)
    else:
        lst.append([inp, inp % 10])
ans = sum(mod0)
lst.sort(key= lambda x :x[1])

if len(lst) != 0:
    last = lst.pop(0)
    ans = sum(mod0)
    for i,imod in lst:
        ans += (i//10 +1)*10
    ans+=last[0]

print(ans)

Buggy python submission (verdict: Runtime Error):
 mod0 = []
lst = []
for i in range(5):
    inp = int(input())
    if inp % 10 == 0:
        mod0.append(inp)
    else:
        lst.append(inp)

ans = sum(mod0)
last = 0
for n, i in enumerate(lst):
    for nn, ii in enumerate(lst):
        if i % 10 < ii % 10:
            last = i
        else:
            last = ii

for i, ii in enumerate(lst):
    if ii == last:
        continue
    ans += (ii // 10 + 1) * 10

print(ans+last)


Fixed submission:
mod0 = []
lst = []
for i in range(5):
    inp = int(input())
    if inp % 10 == 0:
        mod0.append(inp)
    else:
        lst.append([inp, inp % 10])
ans = sum(mod0)
lst.sort(key= lambda x :x[1])

if len(lst) != 0:
    last = lst.pop(0)
    ans = sum(mod0)
    for i,imod in lst:
        ans += (i//10 +1)*10
    ans+=last[0]

print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c = (int(i) for i in input().split())

if a = b and a = c :
    print('Yes')
else:
    print('No')



Fixed submission:
a, b, c = (int(i) for i in input().split())

if a == b and a == c:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n,q = (int(i) for i in input().split())
s = input()

for i in range(q):
    l,r = (int(i) for i in input().split())
    cnt =  s.count('AC',l-1,r)
    print(cnt)

Fixed submission:
dic = {"A":"T","C":"G","T":"A","G":"C"}
print(dic[input()])
Buggy python submission (verdict: Runtime Error):
a, b, k = (int(i) for i in input().split())
cdiv = []
ans = []
a,b = min(a,b),max(a,b)
for i in range(1, a + 1):
    if a % i == 0:
        cdiv.append(i)
for i in cdiv:
    if b % i != 0:
        ans.append(i)


print(ans[len(ans) - k])


Fixed submission:
a,b,th = (int(i) for i in input().split())
lst = []
c = max(a,b)
for i in range(c+1,0,-1):
    if a % i == 0 and b % i == 0:
        lst.append(i)
print(lst[th-1])

Buggy python submission (verdict: Runtime Error):
a,b,th = (int(i) for i in input().split())
lst = []
c = max(a,b)
for i in range(c+1,1,-1):
    if a % i == 0 and b % i == 0:
        lst.append(i)
print(lst[th-1])

Fixed submission:
a,b,th = (int(i) for i in input().split())
lst = []
c = max(a,b)
for i in range(c+1,0,-1):
    if a % i == 0 and b % i == 0:
        lst.append(i)
print(lst[th-1])
Buggy python submission (verdict: Runtime Error):
trash = input()
input_1 = map(int,input().split(' '))
if max(input_1) < (sum(input_1) - max(input_1)):
	print('Yes')
else:
	print('No')

Fixed submission:
trash = input()
input_1 = list(map(int,input().split(' ')))
if max(input_1) < (sum(input_1) - max(input_1)):
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
trash = input()
input_1 = input().split(' ')
if max(input_1) < (sum(input_1) - max(input_1)):
	print('Yes')
else:
	print('No')

Fixed submission:
trash = input()
input_1 = list(map(int,input().split(' ')))
if max(input_1) < (sum(input_1) - max(input_1)):
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
dp = {}

dp[(0, 0, 0)] = 1

def perm(i, j, k):
  if (i, j, k) in dp:
    return dp[(i, j, k)]
  
  if i < 0 or j < 0 or k < 0 or i < j:
    return 0
  
  dp[(i, j, k)] = ((j+j+1)*perm(i-1, j, k-2*j)\
                + (j+1)*(j+1)*perm(i-1, j+1, k-2*j)\
                +  1*perm(i-1, j-1, k-2*j))%int(10e9+7)
  return dp[(i, j, k)]

print(perm(n, 0, k))

Fixed submission:
r = int(input())

print(3*r*r)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for _ in range(n):
  a.append(int(input()))

for i in range(n):
  print(max(a[:i] + a[i+1:]))

Fixed submission:
n = int(input())
a = []
for _ in range(n):
  a.append(int(input()))

m = max(a)
s = sorted(a)

for i in range(n):
  if m is a[i]:
    print(s[-2])
  else:
    print(m)
Buggy python submission (verdict: Runtime Error):
m = int(input())
s = list(map(int, input()))
bs = [0] * m

cnt = 0
for i in range(m, 0, -1):
  b = sum(list(map(lambda x: bs[x-1], list(range(i, m+1, i)))))
  if s[i-1] is 0:
    if  b%2 is 0:
      bs[i-1] = 0
    else:
      cnt += 1
      bs[i-1] = 1
  else:
    if  b%2 is 0:
      cnt += 1
      bs[i-1] = 1
    else:
      bs[i-1] = 0

print(cnt)
print("".join(map(str, bs)))

Fixed submission:
m = int(input())
s = list(map(int, input().split()))
bs = [0] * m

cnt = 0
for i in range(m, 0, -1):
  b = sum(list(map(lambda x: bs[x-1], list(range(i, m+1, i)))))
  if s[i-1] is 0:
    if  b%2 is 0:
      bs[i-1] = 0
    else:
      cnt += 1
      bs[i-1] = 1
  else:
    if  b%2 is 0:
      cnt += 1
      bs[i-1] = 1
    else:
      bs[i-1] = 0

print(cnt)
if cnt > 0:
  print(" ".join([str(i+1) for i, b in enumerate(bs) if b > 0]))
Buggy python submission (verdict: Time Limit Exceeded):
m = int(input())
a = []
for _ in range(m):
  a.append(int(input()))

# a = [2, 1, 4, 5, 3]
# m = len(a)

cs = [0]*m
c_maxs = [a[0]]
minimum = a[0]
maximum = a[0]

for i in range(1, m):
  cont = False
  
  if a[i] <= minimum:
    cont = False
    minimum = a[i]
  elif maximum < a[i]:
    cont = True
    cs[i] = len(c_maxs)-1
    c_maxs[-1] = a[i]
    maximum = a[i]
  else:
    for c, c_max in enumerate(c_maxs):
      if c_max < a[i]:
        cs[i] = c
        c_maxs[c] = a[i]
        cont = True
        break
  
  if not cont:
    cs[i] = len(c_maxs)
    c_maxs.append(a[i])

# print(cs)
print(len(c_maxs))

Fixed submission:
import bisect
m = int(input())
a = []
for _ in range(m):
  a.append(int(input()))

a = list(map(lambda x: -x, a))
m = len(a)

lis = [float('inf')]*m

for x in a:
  lis[bisect.bisect_right(lis, x)] = x

print(len([x for x in lis if not (x == float('inf'))]))

Buggy python submission (verdict: Time Limit Exceeded):
m = int(input())
a = []
for _ in range(m):
  a.append(int(input()))

cs = [0]*m
c_maxs = [a[0]]

for i in range(1, m):
  cont = False
  for c, c_max in enumerate(c_maxs):
    if c_max < a[i]:
      cs[i] = c
      c_maxs[c] = a[i]
      cont = True
      break
  
  if not cont:
    cs[i] = len(c_maxs)
    c_maxs.append(a[i])

print(len(c_maxs))

Fixed submission:
import bisect
m = int(input())
a = []
for _ in range(m):
  a.append(int(input()))

a = list(map(lambda x: -x, a))
m = len(a)

lis = [float('inf')]*m

for x in a:
  lis[bisect.bisect_right(lis, x)] = x

print(len([x for x in lis if not (x == float('inf'))]))
Buggy python submission (verdict: Runtime Error):
if __name__ == "__main__":
    s = input()
    data = list(s)
    while len(data):
         data.pop()
         if len(data) % 2 == 0:
             if data[:len(data) / 2] == data[len(data) / 2 + 1:]:
                 print(len(data) / 2)
                 break

Fixed submission:
if __name__ == "__main__":
    s = input()
    data = list(s)
    while len(data):
        data.pop()
        if len(data) % 2 == 0:
            half = int(len(data) / 2)
            if data[:half] == data[half:]:
                print(len(data))
                break
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = map(int, input().split())
a = [0] + list(a)
b = [0] * (N+1)
result_str = ''

for i in range(N, 0, -1):
  i_sum = sum(b[i::i])
  if i_sum % 2 != a[i]:
    b[i] = 1
    result_str = '{} '.format(i) + result_str

print(sum(b))
print(result_str[:-1])


Fixed submission:
a = int(input())
print(3*(a**2))

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = map(int, input().split())
a = [0] + list(a)
b = [0 for i in range(N+1)]
result_str = ''

for i in range(N, 0, -1):
  i_sum = 0
  for j in range(1, N // i + 1):
    i_sum += b[j*i]
  if i_sum % 2 != a[i]:
    b[i] = 1
    result_str = '{}　'.format(i) + result_str

print(sum(b))
if sum(b) != 0:
    print(result_str[:-1])


Fixed submission:
a = int(input())
print(3*(a**2))

Buggy python submission (verdict: Runtime Error):

r = int(input())
print(fun(r))

def fun(r):
  a = 3 * r**2
  return a



Fixed submission:



def fun(r):
  a = 3 * r**2
  return a

r = int(input())
print(fun(r))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

for i in range(M - 1):
    if A[i] + 1 == A[i + 1]:
        print(0)
        exit()

memo = [0 for i in range(N + 10)]
memo[1] = 1
memo[2] = 2
for i in range(3, N + 10):
    memo[i] = memo[i - 1] + memo[i - 2]

ans = 1
for i in range(M):
    if i == 0:
        tmp = A[i] - 1
        if tmp == 0:
            tmp = 1
    else:
        tmp = A[i] - A[i - 1] - 2
    ans *= memo[tmp]
    ans %= int(1e9 + 7)

if N - A[-1] - 1 != 0:
    ans *= memo[(N - A[-1] - 1)]
    ans %= int(1e9 + 7)
print(ans)



Fixed submission:
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

for i in range(M - 1):
    if A[i] + 1 == A[i + 1]:
        print(0)
        exit()

MAX_N = int(1e5) + 10
memo = [0 for i in range(MAX_N + 10)]
memo[0] = 1
memo[1] = 1
memo[2] = 2
for i in range(3, MAX_N + 10):
    memo[i] = memo[i - 1] + memo[i - 2]

now = 0
ans = 1

for a in A:
    diff = a - now - 1
    ans *= memo[diff]
    ans %= int(1e9 + 7)
    now = a + 1

diff = N - now
ans *= memo[diff]
ans %= int(1e9 + 7)
print(ans)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

for i in range(M - 1):
    if A[i] + 1 == A[i + 1]:
        print(0)
        exit()

memo = [0 for i in range(N + 10)]
memo[1] = 1
memo[2] = 2
for i in range(3, N + 10):
    memo[i] = memo[i - 1] + memo[i - 2]

ans = 1
for i in range(M):
    if i == 0:
        tmp = A[i] - 1
        if tmp == 0:
            tmp = 1
    else:
        tmp = A[i] - A[i - 1] - 2
    ans *= memo[tmp]
    ans %= int(1e9 + 7)

ans *= memo[(N - A[-1] - 1)]
ans %= int(1e9 + 7)
print(ans)



Fixed submission:
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

for i in range(M - 1):
    if A[i] + 1 == A[i + 1]:
        print(0)
        exit()

MAX_N = int(1e5) + 10
memo = [0 for i in range(MAX_N + 10)]
memo[0] = 1
memo[1] = 1
memo[2] = 2
for i in range(3, MAX_N + 10):
    memo[i] = memo[i - 1] + memo[i - 2]

now = 0
ans = 1

for a in A:
    diff = a - now - 1
    ans *= memo[diff]
    ans %= int(1e9 + 7)
    now = a + 1

diff = N - now
ans *= memo[diff]
ans %= int(1e9 + 7)
print(ans)