UVa 10474 - WinDaLex/Programming GitHub Wiki

Where is the Marble?

from Volume 1. Elementary Problem Solving :: Sorting/Searching

Description

找弹珠。每个弹珠都有一个数字(可重复), 且按数字大小给弹珠排序。询问一个数字, 要求输出该数字在弹珠中出现的最小位置。

Solution

给弹珠排序一下, 然后二分查找并输出即可。