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)
全部评论
你***了?
异或前缀 区间想减
相关推荐
点赞 评论 收藏
分享
码农索隆:以下是我以我微薄的认知提供的建议:
1.考个教师资格证,去当体育考试。
2.去健身房当健身教练(因为在我印象里面体育生身材都不错 点赞 评论 收藏
分享
SHEIN希音公司福利 370人发布