Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
ac_numbers = 0 
for i in range(Q):
    l, r = map(int, input().split())
    for j in range(r-l): 
        if S[l-1+j:l+j+1] == 'AC':
            ac_numbers += 1
    print(ac_numbers)
    ac_numbers = 0


Fixed submission:
N, Q = map(int, input().split())
S = input()
L = [0]*Q 
R = [0]*Q
for q in range(Q):
    l, r = map(int, input().split())
    L[q] = l
    R[q] = r
ans = [0]*Q 
accumulative_count = [0]*(N) 
accumulative_count[0] = 0 
for i in range(1, N, 1): 
    accumulative_count[i] = accumulative_count[i-1]
    if (S[i-1:i] == 'A') & (S[i:i+1] == 'C'):
        accumulative_count[i] = accumulative_count[i-1] + 1
for q in range(Q):
    print(accumulative_count[R[q]-1] - accumulative_count[L[q]-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
a = 0
b = 0
L = [0] * Q
R = [0] * Q
ac_numbers = 0 
ac_count = 0 
for i in range(Q):
    a, b = map(int, input().split())
    L[i] = a
    R[i] = b
    for j in range(R[i]-L[i]+1): 
        if ac_count == 0:
            if S[L[i]-1+j] == 'A':
                ac_count = 1
        if ac_count == 1:
            if S[L[i]-1+j] == 'C':
                ac_count = 0
                ac_numbers += 1
            if S[L[i]-1+j] == 'A':
                ac_count = 1
            else:
                ac_count = 0
    print(ac_numbers)
    ac_count = 0
    ac_numbers = 0

Fixed submission:
N, Q = map(int, input().split())
S = input()
L = [0]*Q 
R = [0]*Q
for q in range(Q):
    l, r = map(int, input().split())
    L[q] = l
    R[q] = r
ans = [0]*Q 
accumulative_count = [0]*(N) 
accumulative_count[0] = 0 
for i in range(1, N, 1): 
    accumulative_count[i] = accumulative_count[i-1]
    if (S[i-1:i] == 'A') & (S[i:i+1] == 'C'):
        accumulative_count[i] = accumulative_count[i-1] + 1
for q in range(Q):
    print(accumulative_count[R[q]-1] - accumulative_count[L[q]-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = sorted(list(map(int, input().split())))

while len(A) >= 2: #残りの数が1になったら終わり
  if A[0] == 1: break
  #余りが出る場合は、左側の数字と余りを入れ替える
  rem = A[1] % A[0] #余り
  if rem != 0: A[0], A[1] = rem, A[0]
  #余りが0の場合、そいつは下位互換なので要らない？
  else: del A[1]
  print(A)

print('出たよ'+str(A[0]))

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

while len(A) >= 2: #残りの数が1になったら終わり
  if A[0] == 1: break
  #余りが出る場合は、左側の数字と余りを入れ替える
  rem = A[1] % A[0] #余り
  if rem != 0: A[0], A[1] = rem, A[0]
  #余りが0の場合、そいつは下位互換なので要らない？
  else: del A[1]

print(A[0])
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
#高さ。0~n-1でアクセス

#足場Nにたどり着くまでの最小コストを格納。アクセスは[N-1]
dp = [float("inf")] * n

dp[0] = 0
dp[1] = abs(h[0] - h[1])

#足場x（0～n-1）にたどり着くまでの最小コストを返す関数。
def getdp(x):
    global dp #これでいいのか？
    if dp[x] != float("inf"): return dp[x] #0,1の場合と、既に求めた場合は値を返す
    dp[x] = min(getdp(x-2) + abs(h[x]-h[x-2]), getdp(x-1) + abs(h[x]-h[x-1]))
    #2つ左から飛ぶか1つ左から飛ぶかの最小値がxのdp。
    return(dp[x])

print(getdp(n-1))

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
#高さ。0~n-1でアクセス

#足場Nにたどり着くまでの最小コストを格納。アクセスは[N-1]
dp = [float("inf")] * n

dp[0] = 0
dp[1] = abs(h[0] - h[1])

import sys
sys.setrecursionlimit(10000000)
#足場x（0～n-1）にたどり着くまでの最小コストを返す関数。
def getdp(x):
    global dp #これでいいのか？
    if dp[x] != float("inf"): return dp[x] #0,1の場合と、既に求めた場合は値を返す
    dp[x] = min(getdp(x-2) + abs(h[x]-h[x-2]), getdp(x-1) + abs(h[x]-h[x-1]))
    #2つ左から飛ぶか1つ左から飛ぶかの最小値がxのdp。
    return(dp[x])

print(getdp(n-1))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))
#高さ。0~n-1でアクセス

#足場Nにたどり着くまでの最小コストを格納。アクセスは[N-1]
dp = [-1] * n

dp[0] = 0
dp[1] = abs(h[0] - h[1])

inf = float("inf") #毎回関数を呼び出さないように
import sys
sys.setrecursionlimit(10000000)
#足場x（0～n-1）にたどり着くまでの最小コストを返す関数。
def getdp(x):
    global dp
    global inf
    if dp[x] != -1: return dp[x] #0の場合と、既に求めた場合は値を返す

    #今度はここをfor文にする
    #飛ぶ距離は、1～ min（ジャンプ力, xと0の距離(=x))
    mindp = inf #最小値を初期化
    for i in range(1, min(k, x)+1, 1): #iはジャンプする距離(1~min(k,x))
        nowdp = getdp(x-i) + abs(h[x]-h[x-i])
        mindp = min(mindp, nowdp)
        dp[x] = mindp
    return(dp[x])

print(getdp(n-1))


Fixed submission:
def solve():
  n,k=[int(i) for i in input().split()]
  h=[int(i) for i in input().split()]
  dp=[0]*n
  for i, hi in enumerate(h):
    if i==0: continue
    dp[i]=min([dp[j] + abs(hi-h[j]) for j in range(max(i-k,0),i)])
  return dp[n-1]
print(solve())

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))
#高さ。0~n-1でアクセス

#足場Nにたどり着くまでの最小コストを格納。アクセスは[N-1]
dp = [-1] * n

dp[0] = 0
dp[1] = abs(h[0] - h[1])

inf = float("inf") #毎回関数を呼び出さないように
import sys
sys.setrecursionlimit(10000000)
#足場x（0～n-1）にたどり着くまでの最小コストを返す関数。
def getdp(x):
    global dp
    global inf
    if dp[x] != -1: return dp[x] #0の場合と、既に求めた場合は値を返す

    #今度はここをfor文にする
    #飛ぶ距離は、1～ min（ジャンプ力, xと0の距離(=x))
    mindp = inf #最小値を初期化
    for i in range(1, min(k, x)+1, 1): #iはジャンプする距離(1~min(k,x))
        nowdp = getdp(x-i) + abs(h[x]-h[x-i])
        mindp = min(mindp, nowdp)
        dp[x] = mindp
    return(dp[x])

print(getdp(n-1))


Fixed submission:
def solve():
  n,k=[int(i) for i in input().split()]
  h=[int(i) for i in input().split()]
  dp=[0]*n
  for i, hi in enumerate(h):
    if i==0: continue
    dp[i]=min([dp[j] + abs(hi-h[j]) for j in range(max(i-k,0),i)])
  return dp[n-1]
print(solve())

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))
#高さ。0~n-1でアクセス

#足場Nにたどり着くまでの最小コストを格納。アクセスは[N-1]
dp = [float("inf")] * n

dp[0] = 0
dp[1] = abs(h[0] - h[1])

import sys
sys.setrecursionlimit(10000000)
#足場x（0～n-1）にたどり着くまでの最小コストを返す関数。
def getdp(x):
    global dp
    if dp[x] != float("inf"): return dp[x] #0の場合と、既に求めた場合は値を返す

    #今度はここをfor文にする
    #飛ぶ距離は、1～ min（ジャンプ力, xと0の距離(=x))
    mindp = float("inf") #最小値を初期化
    for i in range(1, min(k, x)+1, 1): #iはジャンプする距離(1~min(k,x))
        nowdp = getdp(x-i) + abs(h[x]-h[x-i])
        mindp = min(mindp, nowdp)
        dp[x] = mindp
    return(dp[x])

print(getdp(n-1))


Fixed submission:
def solve():
  n,k=[int(i) for i in input().split()]
  h=[int(i) for i in input().split()]
  dp=[0]*n
  for i, hi in enumerate(h):
    if i==0: continue
    dp[i]=min([dp[j] + abs(hi-h[j]) for j in range(max(i-k,0),i)])
  return dp[n-1]
print(solve())
Buggy python submission (verdict: Runtime Error):

###template###
import sys
def input(): return sys.stdin.readline().rstrip()
import heapq
INF = float("inf")
def mi(): return map(int, input().split())
def ii(): return int(input())
###template###


S = ii()

prev = 0
sum = 0
for c in S:
  if c == 'B':
    prev += 1
  else:
    sum += prev
    
print(sum)

Fixed submission:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
import heapq
INF = float("inf")
def mi(): return map(int, input().split())
def ii(): return int(input())
###template###


S = input()

prev = 0
sum = 0
for c in S:
  if c == 'B':
    prev += 1
  else:
    sum += prev
    
print(sum)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())

print(a + (b / 2))

Fixed submission:
a, b = map(int, input().split())
 
print(round(a + (b / 2)))
Buggy python submission (verdict: Runtime Error):
nab = [int(input()) for _ in range(3)]

if nab[0] == 1:
  print('Hello World')
else:
  print(nab[1]+nab[2])

Fixed submission:
n = int(input())

if n == 1:
  print('Hello World')
else:
  print(int(input()) + int(input()))
Buggy python submission (verdict: Time Limit Exceeded):
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

N = int(input())
V = list(mi())

oddl = []
evenl = []
cnt = 0
for v in V:
  if cnt % 2 == 0: oddl.append(v)
  else: evenl.append(v)
  cnt += 1

#oddl, evenlに含まれる数の二次元リストを作り、数が多い順にソートする
ocontents = []
econtents = []
oddsetl = list(set(oddl))
evensetl = list(set(evenl))
for o in oddsetl:
  ocontents.append((o, oddl.count(o)))
for e in evensetl:
  econtents.append((e, evenl.count(e)))
ocontents = sorted(ocontents, key=lambda x:-x[1])
econtents = sorted(econtents, key=lambda x:-x[1])

Nd2 = round(N/2) #それぞれの個数
if ocontents[0][0] != econtents[0][0]:
  print(Nd2-ocontents[0][1] + Nd2-econtents[0][1])
elif ocontents[0][1] >= econtents[0][1]:
  if len(econtents)==1: print(Nd2-ocontents[0][1] + Nd2)
  else: print(Nd2-ocontents[0][1] + Nd2-econtents[1][1])
else:
  if len(ocontents)==1: print(Nd2 + Nd2-econtents[0][1])
  else: print(Nd2-ocontents[1][1] + Nd2-econtents[0][1])





Fixed submission:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

N = int(input())
V = list(mi())

oddl = V[0::2]
evenl = V[1::2]

#oddl, evenlに含まれる数をバケットソートする。個数をバケツに入れる
obuckets = [0]*(10**5 + 1)
ebuckets = [0]*(10**5 + 1)
for o in oddl:
  obuckets[o] += 1
for e in evenl:
  ebuckets[e] += 1

o1cnt = max(obuckets)
o1 = obuckets.index(o1cnt)
obuckets[o1] = 0

o2cnt = max(obuckets)
o2 = obuckets.index(o2cnt)
obuckets[o2] = 0

e1cnt = max(ebuckets)
e1 = ebuckets.index(e1cnt)
ebuckets[e1] = 0

e2cnt = max(ebuckets)
e2 = ebuckets.index(e2cnt)
ebuckets[e2] = 0

Nd2 = round(N/2) #それぞれの個数
if o1 != e1:
  print(Nd2-o1cnt + Nd2-e1cnt)
else: print(min(Nd2-o1cnt + Nd2-e2cnt, Nd2-o2cnt + Nd2-e1cnt))
Buggy python submission (verdict: Runtime Error):
n,m,x,y = map(int,input().split())

xis = sorted(list(map(int,input().split())),reverse=True)
yis = sorted(list(map(int,input().split())))
 
ans = 'No War' (if xis[0] < yis[0]) and x < yis[0] and xis[0] < y else 'War'

print(ans)


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

xis = sorted(list(map(int,input().split())),reverse=True)
yis = sorted(list(map(int,input().split())))
 
ans = 'No War' if (xis[0] < yis[0]) and (x < yis[0] and xis[0] < y) else 'War'

print(ans)
Buggy python submission (verdict: Runtime Error):
n  = int(input())
w = []

w.append(input())

ans = 'Yes'
for i in range(1,n,1):
  w.append(input())
  l = len(w[j])
  if w[i][0:1] != w[j][l-1:l]: ans = 'No'
  for j in range(i):
    if w[i] == w[j]: ans = 'No'

print(ans)

Fixed submission:
n  = int(input())
w = []

w.append(input())

ans = 'Yes'
for i in range(1,n,1):
  w.append(input())
  l = len(w[i-1])
  if w[i][0:1] != w[i-1][l-1:l]:
    ans = 'No'
    break
  for j in range(i):
    if w[i] == w[j]:
      ans = 'No'
      break

print(ans)
Buggy python submission (verdict: Runtime Error):
x1,y1,x2,y2 = map(int,input())

x = x2-x1
y = y2-y1

x3 = x2 - y
y3 = y2 + x
x4 = x3 - x
y4 = y3 - y

print(x3,y3,x4,y4)




Fixed submission:
x1,y1,x2,y2 = map(int,input().split())

x = x2-x1
y = y2-y1

x3 = x2 - y
y3 = y2 + x
x4 = x3 - x
y4 = y3 - y

print(x3,y3,x4,y4)
Buggy python submission (verdict: Runtime Error):
n, i = map(int, input())

print(n-i+1)

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

print(n-i+1)
Buggy python submission (verdict: Runtime Error):
a = map(int,input().split())

print(abs(a[0] - a[1]) + abs(a[1] - a[2]))


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

print(abs(a[0] - a[1]) + abs(a[1] - a[2]))

Buggy python submission (verdict: Runtime Error):
a = sorted([int(input()) for _ in range(3)])

print(abs(a[0] - a[1]) + abs(a[1] - a[2]))

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

print(abs(a[0] - a[1]) + abs(a[1] - a[2]))
Buggy python submission (verdict: Runtime Error):

###template###
import sys
def input(): return sys.stdin.readline().rstrip()
import heapq
INF = float("inf")
def mi(): return map(int, input().split())
def ii(): return int(input())
###template###

N = ii()
As = [map(lambda x : int(x) - 1, input().split())]

print(sum(As))

Fixed submission:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
import heapq
INF = float("inf")
def mi(): return map(int, input().split())
def ii(): return int(input())
###template###

N = ii()
As = list(map(lambda x : int(x) - 1, input().split()))

print(sum(As))
Buggy python submission (verdict: Runtime Error):
s = input()

a = 0
for i in range(4):
  a += 1 if s[i:i+1] == "+" else a -= 1
print(a)


Fixed submission:
s = input()
a = 0
for i in range(4):
  a = a + 1 if s[i:i+1] == '+' else a - 1

print(a)

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

a = 0
for i in range(4):
  a += 1 if s[i:i+1] == '+' else a -= 1
print(a)

Fixed submission:
s = input()
a = 0
for i in range(4):
  a = a + 1 if s[i:i+1] == '+' else a - 1

print(a)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

if abs(a-c) <= d:
  print('Yes')
elif (abs(a-b) <= d) && (abs(b-c) <= d):
  print('Yes')
else:
  print('No')


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

if abs(a-c) <= d:
  print('Yes')
elif (abs(a-b) <= d) and (abs(b-c) <= d):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input())

if abs(a-c) <= d:
  print('Yes')
elif (abs(a-b) <= d) && (abs(b-c) <= d):
  print('Yes')
else:
  print('No')

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

if abs(a-c) <= d:
  print('Yes')
elif (abs(a-b) <= d) and (abs(b-c) <= d):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
s = input()

p = 700
for c in s:
  p += 100 if c == 'o'

print(p)

Fixed submission:
s = input()

p = 700
for c in s:
  if c == 'o': p += 100

print(p)
Buggy python submission (verdict: Runtime Error):
n, m, x = map(int,input().split())
a = set(map(int,input().split()))

b = a.copy
for i in range(1,x,1):
  b = b - {i}

c = a.copy
for i in range(x+1,n,1):
  c = c - {i}

print(min(len(b),len(c)))




Fixed submission:
n, m, x = map(int,input().split())
a = set(map(int,input().split()))

b = a
for i in range(1,x,1):
  b = b - {i}

c = a
for i in range(x+1,n,1):
  c = c - {i}

print(min(len(b),len(c)))
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int,input().split())

ans = {i for i in range(a,a+k)}
ans2 = {i for i in range(b,b-k,-1)}

ans.add(ans2)
ans = sorted(list(ans))

for an in ans: print(an) 


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

ans = {i for i in range(a,min(a+k,b+1))}
ans2 = {i for i in range(b,max(b-k,a-1),-1)}

ans = ans | ans2
ans = sorted(list(ans))

for an in ans: print(an)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int,input().split())

ans = {i for i in range(a,b+1) if (i < a+k)or(i>b-k) }

ans = sorted(list(ans))

for an in ans: print(an) 

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

ans = {i for i in range(a,min(a+k,b+1))}
ans2 = {i for i in range(b,max(b-k,a-1),-1)}

ans = ans | ans2
ans = sorted(list(ans))

for an in ans: print(an)
Buggy python submission (verdict: Runtime Error):
aa = [int(input()) for _ in range(4)]

a,b,c,d = map(aa)

print(min(a,b) + min(c,d))

Fixed submission:
aa = [input() for _ in range(4)]

a,b,c,d = map(int, aa)

print(min(a,b) + min(c,d))
Buggy python submission (verdict: Runtime Error):
n = int(input)
A = [0] + list(map(int, input().split())) + [0]

#普通に総和を出す
sum = 0
for i, a in enumerate(A):
  if i == n+1: break #n+1はゴールなので先に行かない
  sum += abs(a - A[i+1]) #a:A[i]
  
#引いて足す
for i in range(1, n+1, 1): #1～Nを省いたとき
  nowsum = sum
  nowsum -= abs(A[i-1]-A[i])
  nowsum -= abs(A[i]-A[i+1])
  nowsum += abs(A[i-1]-A[i+1])
  print(nowsum)


Fixed submission:
n = int(input())
tmpa = list(map(int, input().split()))
A = [0] * (n+2)
A[0] = 0
A[n+1] = 0
for i in range(1,n+1,1): A[i] = tmpa[i-1]


#普通に総和を出す
sum = 0
for i, a in enumerate(A):
  if i == n+1: break #n+1はゴールなので先に行かない
  sum += abs(a - A[i+1]) #a:A[i]
  
#引いて足す
for i in range(1, n+1, 1): #1～Nを省いたとき
  nowsum = sum
  nowsum -= abs(A[i-1]-A[i])
  nowsum -= abs(A[i]-A[i+1])
  nowsum += abs(A[i-1]-A[i+1])
  print(nowsum)

Buggy python submission (verdict: Runtime Error):
n = int(input
A = [0] + list(map(int, input().split())) + [0]

#普通に総和を出す
sum = 0
for i, a in enumerate(A):
  if i == n+1: break #n+1はゴールなので先に行かない
  sum += abs(a - A[i+1]) #a:A[i]
  
#引いて足す
for i in range(1, n+1, 1): #1～Nを省いたとき
  nowsum = sum
  nowsum -= abs(A[i-1]-A[i])
  nowsum -= abs(A[i]-A[i+1])
  nowsum += abs(A[i-1]-A[i+1])
  print(nowsum)


Fixed submission:
n = int(input())
tmpa = list(map(int, input().split()))
A = [0] * (n+2)
A[0] = 0
A[n+1] = 0
for i in range(1,n+1,1): A[i] = tmpa[i-1]


#普通に総和を出す
sum = 0
for i, a in enumerate(A):
  if i == n+1: break #n+1はゴールなので先に行かない
  sum += abs(a - A[i+1]) #a:A[i]
  
#引いて足す
for i in range(1, n+1, 1): #1～Nを省いたとき
  nowsum = sum
  nowsum -= abs(A[i-1]-A[i])
  nowsum -= abs(A[i]-A[i+1])
  nowsum += abs(A[i-1]-A[i+1])
  print(nowsum)
Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())

print(math.ceil(mean([a,b])))


Fixed submission:
import math
import statistics as st

a,b = map(int,input().split())

print(math.ceil(st.mean((a,b))))

Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())

print(math.floor(mean((a,b))))


Fixed submission:
import math
import statistics as st

a,b = map(int,input().split())

print(math.ceil(st.mean((a,b))))

Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())

print(math.floor(mean(a,b)))

Fixed submission:
import math
import statistics as st

a,b = map(int,input().split())

print(math.ceil(st.mean((a,b))))
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
S = []
T = []
for i in range(len(s)):
    S.append(ord(s[i:i+1]))
for i in range(len(t)):
    T.append(ord(t[i:i+1]))
S = sorted(S)
T = sorted(T, reverse=True)
for i in range(100-len(S)): 
    S.append(0)
for i in range(100-len(T)): 
    T.append(0)
for i in range(max(len(s),len(t))+1): 
    if S[i] > T[i]:
        print('No')
        break
    elif S[i] < T[i]:
        print('Yes')
        break
    elif S[i] == 0 and T[i] == 0: 
        print('No')
        break
    elif S[i] == 0: 
        print('Yes')
        break
    elif T[i] == 0: 
        print('No')
        break


Fixed submission:
s = sorted(input())
t = sorted(input(),reverse=True)

ls = len(s)
lt = len(t)

p='No'
for i in range(100):
  if len(t)<=i:
    p = 'No'
    break
  if len(s)<=i:
    p = 'Yes'
    break 
  if s[i:i+1] > t[i:i+1]:
    p = 'No'
    break
  elif s[i:i+1] < t[i:i+1]:  
    p = 'Yes'
    break
   
print(p)
Buggy python submission (verdict: Runtime Error):
n = int(input().rstrip())
values = list(map(int,input().rstrip().
    ssplit()))

m = 500000000 #max divide
for i in range(len(values)):
	nowV = values[i]
	nm = 0
	for j in range(500000000):
		if nowV % 2 == 0:
			nm += 1
			nowV = nowV / 2
			m = min(m,n)
		else:
			break 
print(m)
			


Fixed submission:

n = int(input().rstrip())
values = list(map(int,input().rstrip().split()))

m = 500000000 #max divide
for i in range(len(values)):
	nowV = values[i]
	nm = 0
	for j in range(500000000):
		if nowV % 2 == 0:
			nm += 1
			nowV = nowV / 2
		else:
			break 
	m = min(m,nm)
print(m)
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n = 0:
  print(2)
  exit()
if n = 1:
  print(1)
  exit()

xx = 2
x = 1
for i  in range(n-1):
  ans = xx + x
  xx = x
  x = ans

print(ans)

Fixed submission:
n = int(input())

if n == 0:
  print(2)
  exit()
if n == 1:
  print(1)
  exit()

xx = 2
x = 1
for i in range(n-1):
  ans = xx + x
  xx = x
  x = ans

print(ans)
Buggy python submission (verdict: Runtime Error):
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

N = int(input())

nlist = [0] * (10**9+1)
for _ in range(N):
  i = int(input())
  nlist[i] = ~nlist[i]

print(nlist.count(~0))



Fixed submission:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

N = int(input())

nset = set()

for _ in range(N):
  i = int(input())
  if i in nset: nset.remove(i)
  else: nset.add(i)

print(len(nset))
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
L = sorted(list[map(int,input().split())], reverse=True)

print(sum(L[:K]))



Fixed submission:
N,K = map(int,input().split())
L = sorted(list(map(int,input().split())), reverse=True)

print(sum(L[:K]))
Buggy python submission (verdict: Time Limit Exceeded):
S = input()[:-1]

#残り文字数
lest = len(S)

while 1:
  if lest % 2 == 1: continue
  if S[:lest//2]==S[lest//2:]:
    print(lest)
    exit()
  else:
    lest -= 2
    S = S[:lest]


Fixed submission:
S = input()[:-1]

#残り文字数
lest = len(S)

while 1:
  if lest % 2 == 1:
    lest -= 1
    S = S[:lest]
    continue
  if S[:lest//2]==S[lest//2:]:
    print(lest)
    exit()
  else:
    lest -= 2
    S = S[:lest]
Buggy python submission (verdict: Runtime Error):
a  = ''.join(list(map(input().split())))

print('YES' if (int(a))%4==0 else 'NO')


Fixed submission:
a  = ''.join(list(input().split()))

print('YES' if (int(a))%4==0 else 'NO')

Buggy python submission (verdict: Runtime Error):
a  = ''.join(list(map(input().split())))

print('YES' if int(a)%4==0 else 'NO')

Fixed submission:
a  = ''.join(list(input().split()))

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

print('error' if a+b >= 10 else a+b

Fixed submission:
a, b = map(int, input().split())
 
print('error' if a+b >= 10 else a+b)
Buggy python submission (verdict: Runtime Error):
w,a,b = map(int,input().split())
ma = max(a,b)
mi = min(a,b)
print(max(max-(mi+w),0))

Fixed submission:
w,a,b = map(int,input().split())
ma = max(a,b)
mi = min(a,b)
print(max(ma-(mi+w),0))
Buggy python submission (verdict: Runtime Error):
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
import heapq
INF = float("inf")
MOD = 10**9 + 7
sys.setrecursionlimit(10**7)
# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W
def mi(): return map(int, input().split())
def ii(): return int(input())
###template###


N = ii()

print('1' + ''.join(['0'] * (N-1)))




Fixed submission:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
import heapq
INF = float("inf")
MOD = 10**9 + 7
sys.setrecursionlimit(10**7)
# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W
def mi(): return map(int, input().split())
def ii(): return int(input())
###template###


X = ii()

for t in range(1, 1000000):
  if (t**2 + t) // 2 >= X:
    print(t)
    exit()
Buggy python submission (verdict: Runtime Error):
n = int(input())

mod = 10**9 + 7

ans = 1
for i in range(1, N+1):
  ans = (ans * i) % mod

print(ans)

Fixed submission:
N = int(input())

mod = 10**9 + 7

ans = 1
for i in range(1, N+1):
  ans = (ans * i) % mod

print(ans)