代码拉取完成,页面将自动刷新
# -*- coding: utf-8 -*-
# @project : 《Atcoder》
# @Author : created by bensonrachel on 2021/7/12
# @File : A. Binary Search(CF).py
# https://codeforces.com/edu/course/2/lesson/6/1/practice/contest/283911/problem/A
def re(char,rate:list):
for i in rate:
if(i in char):
print("YES")
else:
print("NO")
def bisearch(l,r,char,x):
while(l+1<r):
mid = (l+r)//2
if(char[mid]==x):
return True
elif(char[mid]<x):
l =mid
else:
r =mid
return False
def bi(n,k,char,rate):
for i in rate:
if(bisearch(-1,n,char,i)):
print("YES")
else:
print("NO")
if __name__ == '__main__':
n,k = map(int,input().split())
char = [int(i) for i in input().split()]
rate = [int(i) for i in input().split()]
#re(char,rate)
bi(n,k,char,rate)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。