#T1115. 二分法 搜索插入位置
二分法 搜索插入位置
Background
给定一个已排列数组和一个目标值,在数组中找到目标值,并返回其索引位置,如果目标值不存在数组中,返回目标值应插入的位置
Description
Given two integers x and y, print the sum.
Format
Input
第一行输入一个整数n,第二行输入n个整数,第三行输入目标数字x
Output
如果存在输出索引位置,不存在输出应插入位置
Samples
4
1 3 5 6
5
2
Limitation
1s, 1024KiB for each test case.