Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
ans = []
for i in reversed(range(n)):
    if A[i]:
        ans.append(i+1)
        tmp = 1
        n = i+1
        while tmp*tmp <= n:
            if n%tmp == 0:
                A[tmp-1] ^= 1
                if tmp != n//tmp:
                    A[n//tmp-1]^=1
            tmp += 1
if len(ans) > 0:
    print(len(ans))
    print(*ans)
else:
    print(0)


Fixed submission:
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
ans = []
for i in reversed(range(n)):
    if A[i]:
        ans.append(i+1)
        tmp = 1
        n = i+1
        while tmp*tmp <= n:
            if n%tmp == 0:
                A[tmp-1] ^= 1
                if tmp != n//tmp:
                    A[n//tmp-1]^=1
            tmp += 1
if len(ans) > 0:
    print(len(ans))
    print(*ans)
else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
ans = []
for i in reversed(range(n)):
    if A[i]:
        ans.append(i+1)
        tmp = 1
        n = i+1
        while tmp*tmp <= n:
            if n%tmp == 0:
                A[tmp-1] ^= 1
                if tmp != n//tmp:
                    A[n//tmp-1]^=1
            tmp += 1
if len(ans) > 0:
    print(len(ans))
    print(*ans)
else:
    print(0)


Fixed submission:
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
ans = []
for i in reversed(range(n)):
    if A[i]:
        ans.append(i+1)
        tmp = 1
        n = i+1
        while tmp*tmp <= n:
            if n%tmp == 0:
                A[tmp-1] ^= 1
                if tmp != n//tmp:
                    A[n//tmp-1]^=1
            tmp += 1
if len(ans) > 0:
    print(len(ans))
    print(*ans)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys
sys.setrecursionlimit(10000000)
#mod = 10**9 + 7
#mod = 9982443453
mod = 998244353
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
li = list(map(int,input().split()))
se = set(li)
if len(se) == 1:
    if sum(se) == 0:
        print('Yes')
    else:
        priont('No')
elif len(se) == 2:
    a,b = sorted(se)
    if a == 0:
        if li.count(a) * 3 == n:
            print('Yes') # 0 count is equal 1
        else:
            print('No')
    else:
        print('No')
elif len(se) == 3:
    a,b,c = se
    if li.count(a) == li.count(b) == li.count(c):
        if a^b == c:
            print('Yes')
        else:
            print('No') # a xor b xor c = 0 is ok
    else:
        print('No')
else:
    print('No')


Fixed submission:
n = int(input())
li = list(map(int,input().split()))
se = set(li)
if len(se) == 1:
    if sum(se) == 0:
        print('Yes')
    else:
        print('No')
elif len(se) == 2:
    a,b = sorted(se)
    if a == 0:
        if li.count(a) * 3 == n:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
elif len(se) == 3:
    a,b,c = se
    if li.count(a) == li.count(b) == li.count(c):
        if a^b == c:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,x = readInts()
L = readInts()
cnt = 0
now = 0
while now <= x:
    cnt += 1
    now += L[cnt-1]
print(cnt)


Fixed submission:
n, x = map(int, input().split())
l = list(map(int, input().split())) + [0] 
d = 0
cnt = 0

for i in range(n + 1):# 0 - n indexed
    if d <= x: cnt += 1
    d = d + l[i]

print(cnt)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
dp = [0] * (n+1)

mod = 10**9 + 7
for i in range(m):
    dp[int(input())] = -1 # 壊れているので、-1としておこう?

dp[0] = 0 # 0段目にいるとしよう
# 1段目が行けなかったら...?
dp[1] = 1 if dp[1] != -1 else -1 # 1段目にいく方法は1通り?
dp[2] = 2 if dp[1] != -1 else (1 if dp[2] != -1 else -1) # 2段目に行く方法は2通り?
for i in range(3,n+1):
    if dp[i] != -1 and dp[i-1] != -1:
        dp[i] += dp[i-1]
        dp[i] %= mod
    if i > 1:
        if dp[i] != -1 and dp[i-2] != -1:
            dp[i] += dp[i-2]
            dp[i] %= mod
print(dp[n]%mod)


Fixed submission:
MOD = 10**9 + 7

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

ban = [False] * (n + 1)

for i in range(m):
    a = int(input())
    ban[a] = True

dp = [0] * (n + 1)
dp[0] = 1

for i in range(n):
    dp[i] %= MOD
    if ban[i]:dp[i] = 0
    #print(i, dp[i])
    if i + 1 <= n:
        dp[i + 1] += dp[i]
    if i + 2 <= n:
        dp[i + 2] += dp[i]

print(dp[n] % MOD)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
A = list(map(int,input().split()))
tehuda = []
for i in range(m):
    b,c = map(int,input().split())
    tehuda.append((b,c))
# とりあえず和
sumA = sum(A)
import heapq
heapq.heapify(A)
tehuda = sorted(tehuda,key = lambda x:x[1])
#print(tehuda)
over = True
while tehuda:
    if not over:
        break
    b,c = tehuda.pop()
    while True:
        m = heapq.heappop(A)
        #print(m,c)
        if m >= c:
            over = False
            break
        else:
            b -= 1
            #print(sumA)
            sumA -= m
            #print(sumA)
            sumA += c
            #print(sumA)
            if b == 0:
                break
print(sumA)


Fixed submission:
n,m = map(int,input().split())
A = list(map(int,input().split()))
tehuda = []
for i in range(m):
    b,c = map(int,input().split())
    tehuda.append((b,c))
# とりあえず和
sumA = sum(A)
import heapq
heapq.heapify(A)
tehuda = sorted(tehuda,key = lambda x:x[1])
#print(tehuda)
over = True
while tehuda:
    if not over:
        break
    b,c = tehuda.pop()
    while True:
        m = heapq.heappop(A)
        #print(m,c)
        if m >= c:
            over = False
            break
        else:
            b -= 1
            sumA -= m
            sumA += c
            heapq.heappush(A,c)
            if b == 0:
                break
print(sumA)
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int,input().split())
res = 0
for i in range(N//R + 1):
    for j in range(N//G + 1):
        if i*R + j*G > N: # はそもそもむり
            continue
        k = (N - R*i - G*j)
        if k % B != 0: # その倍数じゃないと無理
            continue
        res += 1
print(res)


Fixed submission:
R,G,B,N = map(int,input().split())
res = 0
for i in range(N//R + 1):
    for j in range(N//G + 1):
        if i*R + j*G > N: # はそもそもむり
            continue
        k = (N - R*i - G*j)
        if k % B != 0: # その倍数じゃないと無理
            continue
        res += 1
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from itertools import combinations # (string,3) 3回
#from collections import deque
#import collections.defaultdict(list)
#import bisect
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    V = readInts()
    C = readInts()
    ans = -1
    for bit in range(1 << n):
        # bit 全探索
        cost = 0
        value = 0
        for i in range(n):
            if bit & (1 << i):
                # もしフラグが立っていたら、
                cost += C[i]
                value += V[i]
        ans = max(ans,value - cost)
    print(ans)
if __name__ == '__main__':
  main()


Fixed submission:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  n=int(input())
  v=list(map(int,input().split()))
  c=list(map(int,input().split()))
  x=[0]*n
  for i in range(n):
    x[i]=max(0,v[i]-c[i])
  print(sum(x))
if __name__ == '__main__':
  main()
Buggy python submission (verdict: Runtime Error):
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    # 例えば、(A,B,C,D,E) = (5,3,4,2,6) だったら、D = 2の部分で絶対に人が詰まる
    # Dはボトルネック(一番処理がﾀﾞﾒ)
    # N = 100だとすると、最初にDに来てからはずっと2人ずつのせていく
    # 時間で言うと N // 2 = 50 分 かかる計算になる
    # しかし、全員ぴったりくるわけではないので、 (N + bottleneck - 1) // bottleneckにする
    # Dが一番小さいのだから、
    # Dにくるまでは、A,B,C の　3分
    # Dを過ぎてからはE の　1分
    # これは、ボトルネックがDの場合に限らない 合計で 4分
    n = int(input())
    bottleneck = int(input())
    for i in range(n-1):
        bottleneck = min(bottleneck,int(input()))
    #print(bottleneck)
    print((n + bottleneck - 1) // bottleneck + 4) # ボトネで処理するもの　と　来るまでと来た後　の合計

if __name__ == '__main__':
  main()


Fixed submission:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    # 例えば、(A,B,C,D,E) = (5,3,4,2,6) だったら、D = 2の部分で絶対に人が詰まる
    # Dはボトルネック(一番処理がﾀﾞﾒ)
    # N = 100だとすると、最初にDに来てからはずっと2人ずつのせていく
    # 時間で言うと N // 2 = 50 分 かかる計算になる
    # しかし、全員ぴったりくるわけではないので、 (N + bottleneck - 1) // bottleneckにする
    # Dが一番小さいのだから、
    # Dにくるまでは、A,B,C の　3分
    # Dを過ぎてからはE の　1分
    # これは、ボトルネックがDの場合に限らない 合計で 4分
    n = int(input())
    bottleneck = float('inf')
    A = []
    for i in range(5):
        a = int(input())
        A.append(a)
    for i in range(5):
        bottleneck = min(bottleneck,A[i])
    #print(bottleneck)
    print((n + bottleneck - 1) // bottleneck + 4) # ボトネで処理するもの　と　来るまでと来た後　の合計

if __name__ == '__main__':
  main()
Buggy python submission (verdict: Time Limit Exceeded):
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n,q = readInts()
    s = input()
    LR = []
    for i in range(q):
        l,r = readInts()
        #print(LR)
        LR.append((l,r))
    for i in range(q):
        #print(i)
        l,r = LR[i]
        l -=1 # zero based index
        S = s[l:r]
        print(S.count('AC'))

if __name__ == '__main__':
  main()


Fixed submission:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n,q = readInts()
    s = input()
    nya = [0] * (n+1)# 累積和
    for i in range(n):
        if i+1 < n:
            if s[i] == 'A' and s[i+1] == 'C':
                nya[i+1] = nya[i] + 1
            else:
                nya[i+1] = nya[i]
    #print(nya)
    for q_ in range(q):
        l,r = readInts()
        l -=1
        r -=1
        print(nya[r] - nya[l])


if __name__ == '__main__':
  main()

Buggy python submission (verdict: Runtime Error):
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n,q = readInts()
    s = input()
    for i in range(n):
        i,r = readInts()
        i -=1 # zero based index
        S = s[i:r]
        print(S.count('AC'))

if __name__ == '__main__':
  main()


Fixed submission:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n,q = readInts()
    s = input()
    nya = [0] * (n+1)# 累積和
    for i in range(n):
        if i+1 < n:
            if s[i] == 'A' and s[i+1] == 'C':
                nya[i+1] = nya[i] + 1
            else:
                nya[i+1] = nya[i]
    #print(nya)
    for q_ in range(q):
        l,r = readInts()
        l -=1
        r -=1
        print(nya[r] - nya[l])


if __name__ == '__main__':
  main()
Buggy python submission (verdict: Time Limit Exceeded):
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    s = input()
    cnt = 0
    flag = False
    ok = False
    while True:
        if flag:
            break
        i = 0
        while i < len(s)-1:
            ok = False
            if s[i] != s[i+1]: # 違うものが出た
                cnt += 2
                s = (s[:i] + s[i+2:] if len(s) >= 3 else s[:i])
                ok = True
                break
            i += 1
        if not ok:
            break
        if len(s) == 0:
            break
    print(cnt)


if __name__ == '__main__':
  main()


Fixed submission:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    s = input()
    zero = s.count('0')
    one = s.count('1')
    print(min(zero*2,one*2))
if __name__ == '__main__':
  main()

Buggy python submission (verdict: Time Limit Exceeded):
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    s = input()
    cnt = 0
    flag = False
    ok = False
    while True:
        if flag:
            break
        i = 0
        while i < len(s)-1:
            ok = False
            if s[i] != s[i+1]: # 違うものが出た
                cnt += 2
                s = (s[:i] + s[i+2:] if len(s) >= 3 else s[:i])
                ok = True
                break
            i += 1
        if not ok:
            break
        if len(s) == 0:
            break
    print(cnt)


if __name__ == '__main__':
  main()


Fixed submission:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    s = input()
    zero = s.count('0')
    one = s.count('1')
    print(min(zero*2,one*2))
if __name__ == '__main__':
  main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
import math
A = list(map(int,input().split()))
g = 0
for i in range(n):
    g = math.gcd(g,A[i])
print(g)


Fixed submission:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    import fractions
    n = int(input())
    A = readInts()
    g = fractions.gcd(A[0],A[1])
    for i in range(2,n):
        g = fractions.gcd(g,A[i])
    print(g)


if __name__ == '__main__':
  main()
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h = list(map(int,input().split())) + [0] * (n*k)
dp = [float('inf')] * (n*k + 1)
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        dp[i+j] = min(dp[i+j],dp[i] + abs(h[i] - h[i+j]))
print(dp[n-1])


Fixed submission:
n,k = map(int,input().split())
h = list(map(int,input().split())) + [0] * (k)
dp = [float('inf')] * (n*k + 1)
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        dp[i+j] = min(dp[i+j],dp[i] + abs(h[i] - h[i+j]))
print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
n,P = map(int,input().split())
#i = 2
from collections import defaultdict
dic = defaultdict(int)
# 約数分解
if n == 1:
    print(P)
    exit()
i = 2
N = P
while i*i <= N:
    if N%i != 0:
        continue
    num = 0
    while N%i == 0:
        num += 1
        N//=i
    dic[i] = num
if N != 1:
    dic[N] = 1
ans = 1
for k,v in dic.items():
    if v//n >= 1:
        ans *= k ** (v//n)
print(ans)


Fixed submission:
n,P = map(int,input().split())
#i = 2
from collections import defaultdict
dic = defaultdict(int)
# 約数分解
if n == 1:
    print(P)
    exit()
i = 2
N = P
while i*i <= N:
    #print(i,N)
    if N%i != 0:
        i += 1
        continue
    num = 0
    while N%i == 0:
        num += 1
        N//=i
    dic[i] = num
    i += 1
if N != 1:
    dic[N] = 1
ans = 1
for k,v in dic.items():
    if v//n >= 1:
        ans *= k ** (v//n)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,P = map(int,input().split())
#i = 2
from collections import defaultdict
dic = defaultdict(int)
# 約数分解
i = 2
N = P
while i*i <= N:
    if N%i != 0:
        continue
    num = 0
    while N%i == 0:
        num += 1
        N//=i
    dic[i] = num
if N != 1:
    dic[N] = 1
ans = 1
if n == 1:
    print(P)
else:
    for k,v in dic.items():
        #print(k*(v//n))
        if v//n >= 1:
            ans *= k ** (v//n)
    print(ans)


Fixed submission:
n,P = map(int,input().split())
#i = 2
from collections import defaultdict
dic = defaultdict(int)
# 約数分解
if n == 1:
    print(P)
    exit()
i = 2
N = P
while i*i <= N:
    #print(i,N)
    if N%i != 0:
        i += 1
        continue
    num = 0
    while N%i == 0:
        num += 1
        N//=i
    dic[i] = num
    i += 1
if N != 1:
    dic[N] = 1
ans = 1
for k,v in dic.items():
    if v//n >= 1:
        ans *= k ** (v//n)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,P = map(int,input().split())
#i = 2
from collections import defaultdict
dic = defaultdict(int)
# 約数分解
i = 2
N = P
while i*i <= N:
    if N%i != 0:
        continue
    num = 0
    while N%i == 0:
        num += 1
        N//=i
    dic[i] = num
if N != 1:
    dic[N] = 1
ans = 1
if n == 1:
    print(P)
else:
    for k,v in dic.items():
        #print(k*(v//n))
        if v//n >= 1:
            ans *= k * (v//n)
    print(ans)


Fixed submission:
n,P = map(int,input().split())
#i = 2
from collections import defaultdict
dic = defaultdict(int)
# 約数分解
if n == 1:
    print(P)
    exit()
i = 2
N = P
while i*i <= N:
    #print(i,N)
    if N%i != 0:
        i += 1
        continue
    num = 0
    while N%i == 0:
        num += 1
        N//=i
    dic[i] = num
    i += 1
if N != 1:
    dic[N] = 1
ans = 1
for k,v in dic.items():
    if v//n >= 1:
        ans *= k ** (v//n)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
abc = 1
for v in A:
    abc *= v
ans = 0
while abc % 2 == 0:
    ans += 1
    abc//=2
print(ans)


Fixed submission:
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    r = readInts()
    cnt = 0
    for i in range(n):
        while r[i] % 2 == 0:
            cnt += 1
            r[i] //= 2
    print(cnt)



if __name__ == '__main__':
  main()
Buggy python submission (verdict: Time Limit Exceeded):
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    s = input()
    min_ = float('inf')
    for i in range(n):
        min_ = min(min_, s[:i].count('W') + s[i:].count('E'))
    print(min_)


if __name__ == '__main__':
  main()


Fixed submission:
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    s = input()
    min_ = float('inf')
    lw = 0
    le = 0
    rw = s.count('W')
    re = s.count('E')

    # 1番目 [0]番目はあらかじめ計算する
    if s[0] == 'W':
        rw -=1
    else:
        re -=1
    min_ = min(min_,lw+re)
    for i in range(1,n):
        if s[i] == 'W':
            rw -=1
        else:
            re -=1
        if s[i-1] == 'W':
            lw += 1
        else:
            le += 1
        min_ = min(min_,lw + re)
    print(min_)

if __name__ == '__main__':
  main()