Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def find(x):
    if(par[x]==x):
        return x
    else:
        par[x]=find(par[x])
        return par[x]
def union(a,b):
    a=find(a)
    b=find(b)
    if(a==b):
        return 0
    else:
        if rank[a]>rank[b]:
            par[b]=a
        else:
            par[a]=b
            if rank[a]==rank[b]:
                rank[b]+=1
def same(a,b):
    return find(a)==find(b)
def Kruskal(Edge,E):
    cost=0
    Edge.sort(key=lambda x:x[2])
    for i in range(E):
        f,t,c=Edge[i]
        if(not same(f,t)):
            union(f,t)
            cost+=c
    return cost

N=int(input())
par=[i for i in range(N)]
rank=[0 for _ in range(N)]
p=[tuple(map(int,input().split())) for i in range(N)]
dic={p[i]:i for i in range(N)}
xp=sorted(p,key=lambda x:x[0])
yp=sorted(p,key=lambda x:x[1])
Edge=[]
for i in range(N):
    if(i>0):
        Edge.append((dic[xp[i]],dic[xp[i-1]],abs(xp[i][0]-xp[i-1][0])))
    if(i<N-1):
        Edge.append((dic[xp[i]],dic[xp[i+1]],abs(xp[i][0]-xp[i+1][0])))
for i in range(N):
    if(i>0):
        Edge.append((dic[yp[i]],dic[yp[i-1]],abs(yp[i][1]-yp[i-1][1])))
    if(i<N-1):
        Edge.append((dic[yp[i]],dic[yp[i+1]],abs(yp[i][1]-yp[i+1][1])))
Edge.sort(key=lambda x:x[2])

print(Kruskal(Edge,len(Edge)))

Fixed submission:
import sys
read=sys.stdin.readline
def find(x):
    if(par[x]==x):
        return x
    else:
        par[x]=find(par[x])
        return par[x]
def union(a,b):
    a=find(a)
    b=find(b)
    if(a==b):
        return 0
    else:
        if rank[a]>rank[b]:
            par[b]=a
        else:
            par[a]=b
            if rank[a]==rank[b]:
                rank[b]+=1
def same(a,b):
    return find(a)==find(b)
def Kruskal(Edge,E):
    cost=0
    Edge.sort(key=lambda x:x[2])
    for i in range(E):
        f,t,c=Edge[i]
        if(not same(f,t)):
            union(f,t)
            cost+=c
    return cost

N=int(input())
par=[];p=[];dic={};rank=[]
for i in range(N):
    par.append(i)
    rank.append(0)
    p.append(tuple(map(int,read().split())))
    dic[p[i]]=i
xp=sorted(p,key=lambda x:x[0])
yp=sorted(p,key=lambda x:x[1])
Edge=[]
for i in range(N):
    if(i>0):
        Edge.append((dic[xp[i]],dic[xp[i-1]],abs(xp[i][0]-xp[i-1][0])))
    if(i<N-1):
        Edge.append((dic[xp[i]],dic[xp[i+1]],abs(xp[i][0]-xp[i+1][0])))
    if(i>0):
        Edge.append((dic[yp[i]],dic[yp[i-1]],abs(yp[i][1]-yp[i-1][1])))
    if(i<N-1):
        Edge.append((dic[yp[i]],dic[yp[i+1]],abs(yp[i][1]-yp[i+1][1])))
print(Kruskal(Edge,len(Edge)))
Buggy python submission (verdict: Time Limit Exceeded):
INF=10**30
from heapq import heapify,heappop,heappush
N=int(input())
a=list(map(int,input().split()))

right=list(map(lambda x:-x,a[2*N:]));heapify(right)
rmin=[INF]*(3*N);rmin[2*N]=sum(right)*-1

for i in reversed(range(N,2*N)):
    b=min(heappop(right)*-1,a[i])
    heappush(right,b*-1)
    rmin[i]=sum(right)*-1

left=a[:N];heapify(left)
lmax=[-INF]*(3*N);lmax[N-1]=sum(left)
for i in range(N,2*N):
    b=heappop(left)
    heappush(left,max(b,a[i]))
    lmax[i]=sum(left)
res=-INF
for i in range(N,2*N+1):
    res=max(res,lmax[i-1]-rmin[i])
print(res)

Fixed submission:
INF=10**30
from heapq import heapify,heappop,heappush
N=int(input())
a=list(map(int,input().split()))

right=list(map(lambda x:-x,a[2*N:]));heapify(right)
rmin=[INF]*(3*N);rmin[2*N]=sum(right)*-1

for i in reversed(range(N,2*N)):
    p=heappop(right)*-1
    b=min(p,a[i])
    d=0 if b==p else b-p
    heappush(right,b*-1)
    rmin[i]=rmin[i+1]+d

left=a[:N];heapify(left)
lmax=[-INF]*(3*N);lmax[N-1]=sum(left)
for i in range(N,2*N):
    p=heappop(left)
    b=max(p,a[i])
    d=0 if b==p else b-p
    heappush(left,b)
    lmax[i]=lmax[i-1]+d
res=-INF
for i in range(N,2*N+1):
    res=max(res,lmax[i-1]-rmin[i])
print(res)
Buggy python submission (verdict: Runtime Error):
N,W=map(int,input().split())
weight=[0]*N;value=[0]*N
sumv=0
for i in range(N):
    weight[i],value[i]=map(int,input().split())
    sumv+=value[i]
dp=[[10**12]*(sumv+1) for i in range(N+1)]
dp[0][0]=0
for i in range(N):
    for j in range(sumv+1):
        if(value[i]<=j):
            dp[i+1][j]=min(dp[i][j-value[i]]+weight[i],dp[i][j])
        else:
            dp[i+1][j]=min(dp[i+1][j],dp[i][j])
res=0
for i in range(sumv+1):
    if(dp[N][i]<=W):
        res=max(res,i)
print(res)

Fixed submission:
import itertools
N,W=map(int,input().split())
item=[[] for i in range(4)]
for i in range(N):
    w,v=map(int,input().split())
    if(i==0):
        base=w
        item[0].append(v)
    else:
        item[w-base].append(v)
for i in range(4):
    item[i].sort(reverse=True)
l1=len(item[0]);l2=len(item[1]);l3=len(item[2]);l4=len(item[3])
res=0
for x in itertools.product(range(l1+1),range(l2+1),range(l3+1),range(l4+1)):
    if(x[0]*base+x[1]*(base+1)+x[2]*(base+2)+x[3]*(base+3)>W):
        continue
    tmp=sum(item[0][:x[0]])+sum(item[1][:x[1]])+sum(item[2][:x[2]])+sum(item[3][:x[3]])
    res=max(res,tmp)
print(res)
Buggy python submission (verdict: Runtime Error):
MOD=1000000007
def modpow(a,n,mod):
    res=1
    a=a%mod
    while(n>0):
        if(n&1):
            res=res*a%mod
        a=a*a%mod
        n>>=1
    return res

N=int(input())
A=list(map(int,input().split()))
cnt=[0]*10001
for i in range(N):
    cnt[A[i]]+=1
if(N%2==1):
    if(cnt[0]!=1):
        print(0)
        exit()
    for i in range(2,N,2):
        if(cnt[i]!=2):
            print(0)
            exit()
elif(N%2==0):
    for i in range(1,N,2):
        if(cnt[i]!=2):
            print(0)
            exit()
print(modpow(2,N//2,MOD))

Fixed submission:
MOD=1000000007
def modpow(a,n,mod):
    res=1
    a=a%mod
    while(n>0):
        if(n&1):
            res=res*a%mod
        a=a*a%mod
        n>>=1
    return res

N=int(input())
A=list(map(int,input().split()))
cnt=[0]*100001
for i in range(N):
    cnt[A[i]]+=1
if(N%2==1):
    if(cnt[0]!=1):
        print(0)
        exit()
    for i in range(2,N,2):
        if(cnt[i]!=2):
            print(0)
            exit()
elif(N%2==0):
    for i in range(1,N,2):
        if(cnt[i]!=2):
            print(0)
            exit()
print(modpow(2,N//2,MOD))
Buggy python submission (verdict: Runtime Error):
S=input()
print(S)
while(len(S)>=5):
    if(S[len(S)-7:len(S)]=='dreamer'):
        S=S[:len(S)-7]
    elif(S[len(S)-6:len(S)]=='eraser'):
        S=S[:len(S)-6]
    elif(S[len(S)-5:len(S)]=='dream' or S[len(S)-5:len(S)]=='erase'):
        S=S[:len(S)-5]
    else:
        print("NO")
        exit()
    print(S)
if(len(S)!=0):
    print("NO")
else:
    print("YES")

Fixed submission:
S=input()
while(len(S)>=5):
    if(len(S)>=7 and S[len(S)-7:len(S)]=='dreamer'):
        S=S[:len(S)-7]
    elif(len(S)>=6 and S[len(S)-6:len(S)]=='eraser'):
        S=S[:len(S)-6]
    elif(S[len(S)-5:len(S)]=='dream' or S[len(S)-5:len(S)]=='erase'):
        S=S[:len(S)-5]
    else:
        print("NO")
        exit()
if(len(S)!=0):
    print("NO")
else:
    print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
N=int(input())
T,A=map(int,input().split())
for i in range(1,N):
    nT,nA=map(int,input().split())
    m,p=nT,nA
    while(nT<T or nA<A):
        nT+=m;nA+=p
    T,A=nT,nA
print(T+A)

Fixed submission:
import fractions
N=int(input())
T,A=map(int,input().split())
for i in range(1,N):
    nT,nA=map(int,input().split())
    if(nT>=T and nA>=A):
        T,A=nT,nA
        continue
    pT,pA=T//nT,A//nA
    if(T%nT!=0):
        pT+=1
    if(A%nA!=0):
        pA+=1
    T,A=nT*max(pT,pA),nA*max(pT,pA)
print(T+A)
Buggy python submission (verdict: Time Limit Exceeded):
class BIT:
    def __init__(self,N):
        self.N=N
        self.bit=[0]*(N+1)
        self.b=1<<N.bit_length()-1
    def add(self,a,w):
        x=a
        while(x<=self.N):
            self.bit[x]+=w
            x+=x&-x
    def get(self,a):
        ret,x=0,a-1
        while(x>0):
            ret+=self.bit[x]
            x-=x&-x
        return ret
    def cum(self,l,r):
        return self.get(r)-self.get(l) 
    def lowerbound(self,w):
        if w<=0:
            return 0
        x=0
        k=self.b
        while k>0:
            if x+k<=self.N and self.bit[x+k]<w:
                w-=self.bit[x+k]
                x+=k
            k//=2
        return x+1

N=int(input())
A=list(map(int,input().split()))
dic={}
for i in range(N):
    dic[A[i]]=i+1
bit=BIT(N)
ans=0
for i in range(1,N+1):
    d=dic[i]
    bit.add(d,1)
    c=bit.get(d+1)
    L=bit.lowerbound(c-1)
    R=bit.lowerbound(c+1)
    ans+=(R-d)*(d-L)*i
print(ans)


Fixed submission:
class BIT:
    def __init__(self,N):
        self.N=N
        self.bit=[0]*(N+1)
        self.b=1<<N.bit_length()-1
    def add(self,a,w):
        x=a
        while(x<=self.N):
            self.bit[x]+=w
            x+=x&-x
    def get(self,a):
        ret,x=0,a-1
        while(x>0):
            ret+=self.bit[x]
            x-=x&-x
        return ret
    def cum(self,l,r):
        return self.get(r)-self.get(l) 
    def lowerbound(self,w):
        if w<=0:
            return 0
        x=0
        k=self.b
        while k>0:
            if x+k<=self.N and self.bit[x+k]<w:
                w-=self.bit[x+k]
                x+=k
            k//=2
        return x+1

N=int(input())
A=list(map(int,input().split()))
dic={}
for i in range(N):
    dic[A[i]]=i+1
bit=BIT(N)
ans=0
for i in range(1,N+1):
    d=dic[i]
    bit.add(d,1)
    c=bit.get(d+1)
    L=bit.lowerbound(c-1)
    R=bit.lowerbound(c+1)
    ans+=(R-d)*(d-L)*i
print(ans)
Buggy python submission (verdict: Runtime Error):
N,A=map(int,input().split())
x=list(map(int,input().split()))
dp=[[[0]*(N*N+100) for j in range(N+10)] for i in range(N+10)]
dp[0][0][0]=1
for i in range(N):
    for j in range(N+1):
        for k in range(sum(x)+1):
            if(dp[i][j][k]!=0):
                dp[i+1][j][k]+=dp[i][j][k]
                dp[i+1][j+1][k+x[i]]+=dp[i][j][k]
print(sum(dp[N][i][i*A] for i in range(1,N+1)))

Fixed submission:
N,A=map(int,input().split())
x=list(map(int,input().split()))
dp=[[[0]*2600 for j in range(N+10)] for i in range(N+10)]
dp[0][0][0]=1
for i in range(N):
    for j in range(N+1):
        for k in range(2501):
            if(dp[i][j][k]!=0):
                dp[i+1][j][k]+=dp[i][j][k]
                dp[i+1][j+1][k+x[i]]+=dp[i][j][k]
print(sum(dp[N][i][i*A] for i in range(1,N+1)))
Buggy python submission (verdict: Time Limit Exceeded):
import math
import sys
import os

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

def divisor_count(n):
    divisors = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors += 1
            if i != n // i:
                divisors += 1  
    return divisors    

N = I()
ans = 0

for i in range(1,N):
    ans += divisor_count(i)

print(ans)

Fixed submission:
import math
import sys
import os

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

def divisor_count(n):
    divisors = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors += 1
            if i != n // i:
                divisors += 1  
    return divisors    

N = I()
ans = 0

# for i in range(1,N):
#     ans += divisor_count(i)

for i in range(1,N):
    ans += (N-1)//i

print(ans)
Buggy python submission (verdict: Runtime Error):
import math
import sys
import os
import numpy as np

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")
MOD = 998244353    

N,K = LI()
LRs = [LI() for _ in range(K)]

S = set()
for LR in LRs:
    for i in range(LR[0],LR[1]+1):
        S.add(i)

cell = [0]*(N)
cell[0] = 1

# Sa = sorted(list(S),reverse=True)
for i in range(N):
    for s in S:
        if i+s<N:
            cell[i+s]+=cell[i]


# for s in Sa:
#     i = 0
#     while i+s<N:
#         # print(i,s)
#         cell[i+s] += cell[i]
#         i += 1
#     print(s,cell)
ans = cell[-1]
print(ans)

Fixed submission:
import math
import sys
import os
# import numpy as np

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")
MOD = 998244353    

# もらうDP, 区間の和を足しこむ
N,K = LI()
LRs = [LI() for _ in range(K)]

# S = set()
# for LR in LRs:
#     for i in range(LR[0],LR[1]+1):
#         S.add(i)

# cell = [0]*(N)
# cell[0] = 1

# Sa = sorted(list(S),reverse=True)
# for i in range(N):
#     for s in S:
#         if i+s<N:
#             cell[i+s]+=cell[i]

dp = [0]*(N+1)
# 組み合わせの数の累積和(区間和を足しこむため)
cum = [0]*(N+1)
dp[1] = 1
cum[1] = 1
for i in range(2, N+1):
    for j in range(K):
        l, r = LRs[j]
        start = max(0,i-r-1)
        end = max(0,i-l)
        # print('l,r: ',l,r)
        # print('start,end', start,end)
        dp[i] += cum[end] - cum[start]
        # dp[i] += cum[i-l]
        # if i - l >= 0:
        #     dp[i] += cum[i-l]
        # if i - (r+1) >= 0:
        #     dp[i] -= cum[i-(r+1)]
    # dp[i] = (dp[i] % MOD + MOD) % MOD
    dp[i] %= MOD
    # 累積和を更新
    cum[i] = (cum[i-1] + dp[i]) % MOD
print(dp[N])

# for s in Sa:
#     i = 0
#     while i+s<N:
#         # print(i,s)
#         cell[i+s] += cell[i]
#         i += 1
#     print(s,cell)
# ans = cell[-1]
# print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

MOD = 10 ** 9 + 7

N = I()
A = LI()
ans = 0

for i in range(N-1):
    for j in range(i+1,N):
        ans += A[i]*A[j] % MOD
       
print(ans%MOD)

Fixed submission:
import math
import sys
import os
from operator import mul
import numpy as np

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

MOD = 10 ** 9 + 7

N = I()
A = LI()
ans = 0

# A = np.array(A)
sum = [0]*(N+1)
for i in range(N):
        sum[i+1] = sum[i]+A[i]

for i in range(N-1):
    ans += A[i] * (sum[N] - sum[i+1]) % MOD

       
print(ans%MOD)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

MOD = 10 ** 9 + 7

N = I()
A = LI()
ans = 0

for i in range(N-1):
    for j in range(i+1,N):
        ans = (ans + A[i]*A[j]) % MOD
       
print(ans%MOD)

Fixed submission:
import math
import sys
import os
from operator import mul
import numpy as np

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

MOD = 10 ** 9 + 7

N = I()
A = LI()
ans = 0

# A = np.array(A)
sum = [0]*(N+1)
for i in range(N):
        sum[i+1] = sum[i]+A[i]

for i in range(N-1):
    ans += A[i] * (sum[N] - sum[i+1]) % MOD

       
print(ans%MOD)
Buggy python submission (verdict: Runtime Error):
import sys
import os
from collections import deque

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")

INF = float("inf")

H,W = LI()
C = LI()
D = LI()
maze = [list(_S()) for i in range(H)]

def bfs():
    # すべてのマスを INF で初期化
    d = [[INF] * W for i in range(H)]
    
    sx = C[0]-1
    sy = C[1]-1
    gx = D[0]-1
    gy = D[1]-1

    # スタート地点をキューに入れ、ワープ数を0にする
    que = deque([])
    que.append((sx, sy))
    d[sx][sy] = 0

    # ワープ対象
    que2 = deque([])

    # 移動4方向のベクトル
    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]

    # ワープのベクトル
    dx2 = [-2, -2, -2, -2, -2, -1, -1, -1, -1,  0, 0, 1, 1,  1,  1, 2, 2, 2,  2, 2]
    dy2 = [-2, -1,  0,  1,  2, -2, -1,  1,  2, -2, 2, 2, 1, -1, -2, 2, 1, 0, -1, -2]

    while que: 
        while que:
            p = que.popleft()       
            # 取り出してきた状態がゴールなら探索をやめる
            if p[0] == gx and p[1] == gy:
                ans = d[p[0]][p[1]]
                print(ans)
                exit()
            que2.append((p[0], p[1]))
            # 移動4方向をループ
            for i in range(4):
                # 移動した後の点を (nx, ny) とする
                nx = p[0] + dx[i]
                ny = p[1] + dy[i]

                # 移動可否判定、d[nx][ny] == INF であれば訪れたことがない
                if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] != "#" and d[nx][ny] == INF:
                    # 移動できるならキューに入れ、その点のワープ回数を p までのワープ回数で確定する
                    que.append((nx, ny))
                    d[nx][ny] = d[p[0]][p[1]]
                    
        while que2:
            # キューの先頭を取り出す
            p = que2.popleft()
            for i in range(20):
            # for dxi in range(-2,3):
            #     for dyi in range(-2,3):
                nx = p[0] + dx2[i]
                ny = p[1] + dy2[i]
                if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] != "#" and d[nx][ny] == INF:
                    # 移動できるならキューに入れ、その点のワープ回数を p からのワープ回数 +1 で確定する
                    que.append((nx, ny))
                    d[nx][ny] = d[p[0]][p[1]]+1  
        # print('after que2: ',d)  
    return

bfs()
print(-1)

Fixed submission:
import math
import numpy as np
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353    

# N = I()
N,X,T = LI()

ans = math.ceil(N/X) * T

print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

N,Q = LI()
_c = LI()
_lr = [LI() for _ in range(Q)]
lr = np.array(_lr)
c = np.zeros(N + 1)
c[1:] = _c

for pair in lr:
    print(len(set(c[pair[0]:pair[1]+1])))


Fixed submission:
import bisect,collections,copy,heapq,itertools,math,string
from collections import defaultdict as D
from functools import reduce
import numpy as np
from numba import njit
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

X = I()
if X >= 30:
    ans = True
else:
    ans = False

if ans:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import bisect,collections,copy,heapq,itertools,math,string,decimal
import numpy as np
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

N,K = LI()
_A = LI()

# A = np.array(_A, dtype='float128')
A = np.array(_A, dtype=decimal.Decimal)

A /= decimal.Decimal(10)
# print(A)

Aprod = np.zeros(N + 1, dtype=np.dtype(decimal.Decimal))
# Aprod = np.zeros(N + 1, dtype='float128')
Aprod[0] = 1
Aprod[1:] = np.cumprod(A)
# print(Aprod)

# print(Aprod)
result = np.zeros(N+1-K,dtype=np.dtype(decimal.Decimal))
# result = np.zeros(N+1-K,dtype='float128')
result = Aprod[K:] / Aprod[0:N+1-K]

# print(result)
ans = []
for i in range(1, N+1-K):
    if result[i] <= result[i-1]:
        ans.append('No')
    else:
        ans.append('Yes')

print('\n'.join(ans))

# 5 3
# 96 98 100000000 100000000 100000000

Fixed submission:
import decimal
import numpy as np
import sys

def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

N,K = LI()
A = LI()

ans = []

for i in range(K,N):
    if A[i-K] < A[i]:
        ans.append('Yes')
    else:
        ans.append('No')

print('\n'.join(ans))