[OpenJudge-NOI]List stl
来源:互联网 发布:淘宝上女包好卖吗 编辑:程序博客网 时间:2024/05/22 02:30
代码
#include <cstdio>#include <iostream>#include <cstring>#include <list>#include <map>using namespace std;map<int,list<int> > m;int n,x,y;char op[10000];int main(){ scanf("%d",&n); while(n--){ scanf("%s",op); if(strcmp(op,"new")==0){ scanf("%d",&x); m.insert(map<int,list<int> >::value_type(x,list<int>())); } if(strcmp(op,"add")==0){ scanf("%d%d",&x,&y); m[x].push_back(y); } if(strcmp(op,"merge")==0){ scanf("%d%d",&x,&y); m[x].merge(m[y]); //m[y].clear(); } if(strcmp(op,"unique")==0){ scanf("%d",&x); m[x].sort(); m[x].unique(); } if(strcmp(op,"out")==0){ scanf("%d",&x); m[x].sort(); list<int>::iterator it; for(it=m[x].begin();it!=m[x].end();it++){ printf("%d ",*it); } printf("\n"); } }}
0 0
- [OpenJudge-NOI]List stl
- [OpenJudge-NOI]词典 stl
- [OpenJudge-NOI]Set stl
- NOI OpenJudge 1159 Maze
- NOI OpenJudge 1805 碎纸机
- NOI OpenJudge 726 ROADS
- noi openjudge 数字组合
- OpenJudge-Noi 1996 登山
- noi.openjudge 11207 机器翻译
- noi.openjudge 1909 直方图
- NOI openjudge 1792.迷宫
- openjudge noi 9278 旅行
- openjudge noi 1805 碎纸机
- OPENJUDGE LIST
- [OpenJudge-NOI]最大公约数与最小公倍数
- [OpenJudge-NOI]神奇序列求和
- [OpenJudge-NOI]最大公约数与最小公倍数
- [OpenJudge-NOI]最接近的分数
- Netty in action study
- 【struts2】五大核心jar包 和 作用
- ajax相同url执行多次
- 第三方
- RAC 的一些概念性和原理性的知识
- [OpenJudge-NOI]List stl
- IntelliJ IDEA15 配置Gradle 部署 (导入项目)
- SQL Server 更改数据/日志文件位置
- Android软键盘弹出,界面整体上移的问题
- 函数调用--笔记
- CICSP2016 第二届计算智能通信及信号处理国际会议
- iOS开发- UICollectionView详解+实例
- std::string 和 c风格字符串
- javascript高级开发学习笔记六