640: Binary search

解法:

python 复制代码
a, b = map(int, input().split())
l = list(map(int, input().split()))
if b in l:
    print(l.index(b) + 1)
else:
    print(-1)
相关推荐
Codefengfeng29 分钟前
Python Base环境中加包的方法
开发语言·python
清水白石00830 分钟前
《Python 编程全景解析:从核心精要到测试替身(Test Doubles)五大武器的实战淬炼》
开发语言·python
如若1231 小时前
AutoDL云服务器 NVIDIA 570驱动 EGL渲染修复全记录
运维·服务器·python
甲枫叶2 小时前
【claude】Claude Code正式引入Git Worktree原生支持:Agent全面实现并行独立工作
java·人工智能·git·python·ai编程
清水白石0082 小时前
《Python 编程全景解析:从核心精要到 Hypothesis 属性基测试的边界探索》
开发语言·python
勇往直前plus3 小时前
深入理解 Python 内存模型:模块、类、对象的存储与运行机制
开发语言·python
yunhuibin3 小时前
NIN网络学习
人工智能·python·深度学习·神经网络·学习
派大星-?3 小时前
自动化测试五模块一框架(下)
开发语言·python
两万五千个小时4 小时前
构建mini Claude Code:02 - 把 Bash 拆成专用工具(read_file, write_file 等)
人工智能·python
henry1010105 小时前
Ansible自动化运维全攻略(AI生成)
linux·运维·python·ansible·devops