UVA 10474 Where is the Marble?
来源:互联网 发布:为什么淘宝衣服很便宜 编辑:程序博客网 时间:2024/06/06 15:49
水题
#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>using namespace std;const int MAXN = 10010;int pos[MAXN],a[MAXN];int main(){ int n,x,Q,cnt(0); while(~scanf("%d%d",&n,&Q) && n + Q){ for(int i = 1;i <= n;i ++) scanf("%d",a + i); sort(a+1,a+1+n); memset(pos,0,sizeof pos); for(int i = 1;i <= n;i ++) pos[a[i]] = pos[a[i]] ? pos[a[i]] : i; printf("CASE# %d:\n",++cnt); for(int i = 0;i < Q;i ++){ scanf("%d",&x); if(pos[x]) printf("%d found at %d\n",x,pos[x]); 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
- 布局管理器(章节摘要)
- 第三章 数组和字符串
- 邮件服务器实例(debian+posfix+cyrus+squirrelmail)
- hdu 1003 Max Sum dp
- cas入门之二十二:自动单点登出之后的问题
- UVA 10474 Where is the Marble?
- ubuntu 命令行模式和图形界面切换
- hibernate中session一级缓存机制
- Class create, device create, device create file
- windows下查看linux的文件时中文乱码
- 数据结构学习笔记3
- Probability Through Experiments
- Android中资源文件夹res/raw和assets的使用
- svn status 返回值详解