UVa 10474 - Where is the Marble?
来源:互联网 发布:苹果电脑绘画软件 编辑:程序博客网 时间:2024/06/15 18:06
水题,一开始不会,照例题敲,然后刚才又自己写了一遍,感觉就是不一样- -
#include<cstdio>#include<algorithm>#define MAXN 10000using namespace std;int marble[MAXN];int main() { int x, n, q, kase = 0; while(scanf("%d%d", &n, &q) == 2 && n) { for(int i = 0; i < n; i++) scanf("%d", &marble[i]); sort(marble, marble + n); printf("CASE# %d:\n", ++kase); while(q--){ scanf("%d", &x); int p = lower_bound(marble, marble + n, x) - marble; if(marble[p] == x) printf("%d found at %d\n", x, p + 1); else printf("%d not found\n", x); } } return 0;}
0 0
- UVa 10474 Where is the Marble?
- Uva 10474 Where is the Marble?
- uva 10474 Where is the Marble?
- UVA 10474 Where is the Marble?
- UVA 10474 - Where is the Marble
- uva-10474 - Where is the Marble?
- uva 10474 - Where is the Marble?
- UVA 10474 - Where is the Marble?
- UVa 10474 - Where is the Marble?
- UVa 10474 - Where is the Marble
- UVa 10474 - Where is the Marble?
- UVA 10474 Where is the Marble?
- UVA 10474 - Where is the Marble
- UVa - 10474 - Where is the Marble?
- uva 10474 Where is the Marble?
- uva 10474 Where is the Marble?
- uva - 10474 - Where is the Marble?
- uva 10474 - Where is the Marble
- 操作远程数据时,无法保存时,可以用sql语句指令修改
- spring Jdbc自动获取主键。
- java.lang.OutOfMemoryError处理错误
- java.lang.Long cannot be cast to java.lang.Integer
- 基于opencv的人脸检测代码
- UVa 10474 - Where is the Marble?
- 关于学习Java
- Android中Activity启动模式
- 用Apache Commons FileUpload组件实现文件上传
- 单位根检验
- Spring 中配置定时器
- Linux使用技巧1--挂载U盘和Windwos分区
- 大范甘迪大范甘迪
- iOS中的堆(heap)和栈(stack)的理解