2025春招小米 and 美团的笔试....
from collections import Counter
m,n=map(int,input().split())
st1=map(str,input().split())
st2=''.join(st1)
result=[]
for i in range(n):
count=0
b,c=map(int,input().split())
a_=st2[b-1:c]
counter = Counter(a_) # 记录字典
for key,value in counter.items():
if value>2 and value%2!=0:
count+=(value-1)/2
if value%2==0:
count+=value/2
if count==(c-b+1)/2:
result.append('yes')
else:
result.append('no')
for i in result:
print(i)
全部评论
你***了?
异或前缀 区间想减
相关推荐
2025-12-19 16:30
C++ Twilight_m...:这些企业都这B样。本质先把人骗进去,真信有转正猛猛卷,到时候了再来句:“抱歉同学我们业务调整,没hc了,你再看看其他机会吧。”
点赞 评论 收藏
分享
点赞 评论 收藏
分享
