hdu 5233 Gunner II 【set+map】
来源:互联网 发布:matlab提取矩阵一部分 编辑:程序博客网 时间:2024/05/22 01:31
题意不说了,之所以贴代码是因为想说容器是个很好的东西
#include<stdio.h>#include<string.h>#include<algorithm>#include<iostream>#include<set>#include<map>using namespace std;map<int,set<int> >mp;set<int>::iterator it;int main(){ int n,m,x; while(~scanf("%d%d",&n,&m)) { mp.clear(); for(int i=1;i<=n;i++) { scanf("%d",&x); mp[x].insert(i); } while(m--) { scanf("%d",&x); it=mp[x].begin(); if(it==mp[x].end()) printf("-1\n"); else printf("%d\n",*it); mp[x].erase(*it); } } return 0;}
0 0
- hdu 5233 Gunner II 【set+map】
- hdu 5233 Gunner II (map离散化)
- HDU 5233 Gunner II 数据结构map+vector
- hdu 5233 Gunner II
- hdu 5233 Gunner II
- hdu 5233 Gunner II
- HDU ACM 5233 Gunner II
- HDU 5233 Gunner II (二分)
- hdu 5233 Gunner II【STL应用】【水题】
- hdu 5233 Gunner II (容器)
- hdu 5233 Gunner II 离散化
- hdoj--5233--Gunner II(map+queue&&二分)
- hdu 5233 Gunner II(数据离散化存储)
- hdu 5233- Gunner II(BestCoder Round #42)离散化
- 【BestCoder】 HDOJ 5233 Gunner II
- hdoj 5233 Gunner II 【二分】
- HDOJ 5233 Gunner II【二分&&邻接表】
- hdu5233 Gunner II
- 【python学习资料】各种python 函数参数定义和解析 --转载自byte_way
- Android 手机信号 dBm, asu
- Eclipse操作小技巧 , 快捷键
- Elliptic Curve Cryptography: a gentle introduction
- UIKit坐标系
- hdu 5233 Gunner II 【set+map】
- 150Evaluate Reverse Polish Notation
- Android判断用户2G/3G/4G移动数据网络
- spring 事务没有回滚
- 剑指offer 23 - 从上往下打印二叉树
- wifi和数据连接的判断
- Github 树形菜单插件
- android 获取手机网络状态
- 命令行某个文件不能运行