Uva10474——Where is the Marble?
来源:互联网 发布:无锡亿美网络 编辑:程序博客网 时间:2024/05/16 10:57
#include <algorithm>#include <iostream>using namespace std;const int maxn = 10000;int main(){int n, q, x, a[maxn], kase = 0;while(cin >> n >> q && n){for(int i = 0; i < n; i++)cin >> a[i];sort(a, a + n);cout << "CASE# " << ++kase << ":" << endl;while(q--){cin >> x;int p = lower_bound(a, a + n, x) - a;if(a[p] == x)cout << x << " found at " << p + 1 << endl;elsecout << x << " not found" << endl;}}return 0;}
0 0
- Uva10474——Where is the Marble?
- uva10474 - Where is the Marble?
- UVa10474 Where is the Marble?
- UVA10474-Where is the Marble?
- UVA10474 Where is the Marble?
- uva10474 - Where is the Marble?
- uva10474 Where is the Marble?
- uva10474 - Where is the Marble?
- UVA10474 Where is the Marble?
- UVA10474 Where is the Marble?
- UVA10474 Where is the Marble?
- UVa10474-Where is the Marble?
- uva10474大理石在哪儿where is the marble?
- UVA10474 where is the Marble? STL初步
- 5-1 UVa10474 Where is the Marble?
- UVA10474-5.1-Where is the Marble?
- UVA10474 Where is the Marble?(二分查找,STL-lower_bound)
- Where is the Marble
- Java中的网络编程
- IOS开发-C基础2
- 线程相关
- Xcode开发中遇到的Bug
- ASP导出为Word或Excel的最简单方法
- Uva10474——Where is the Marble?
- Hough变换在直线提取中的改进
- oh my zsh
- 解析jQuery的链式编程
- php.ini 核心配置选项说明
- 执行shell脚本方法总结
- MATLAB中如何删除全零行或者列
- javascript延迟加载图片
- android 控件不同状态 selector----drawable