[OpenJudge-NOI]Set stl
2015-11-05 11:12
155 查看
代码
#include <cstdio> #include <cstring> #include <iostream> #include <set> #include <algorithm> using namespace std; multiset<int> s; int n,x,f[100005]; char op[1000]; int main(){ cin>>n; memset(f,0,sizeof(f)); while(n--){ scanf("%s%d",op,&x); if(strcmp(op,"add")==0){ s.insert(x); f[x]=1; cout<<s.count(x)<<endl; } if(strcmp(op,"del")==0){ cout<<s.count(x)<<endl; s.erase(x); } if(strcmp(op,"ask")==0){ cout<<f[x]<<" "; cout<<s.count(x)<<endl; } } }
相关文章推荐
- [OpenJudge-NOI]词典 stl
- crontab 启动 、运行 和编辑 查看
- 【C/C++】Linux下使用system()函数一定要谨慎
- OpenGL ES 3.0之Shader and program(七)
- DisplayImageOptions
- tomcat server.xml maxPostSize=0 导致 果post表单收不到参数解决方案
- linux 得到内网外网ip
- log4j.properties详解与例子
- OpenStack Liberty 版本 All-In-One 一键安装ISO 及安装指导
- Linux 关机 shutdown -h now 提示 bash:command not found
- 一例千万级pv高性能高并发网站架构
- myeclipse更改类或者是配置文件不用重启tomcat的方法
- linux:Bash常用快捷键
- 【嵌入式linux】(第三步):安装串口终端 (ubuntu安装minicom串口终端)
- openssl 证书操作命令
- ubuntu cp(copy) command
- mysql linux 下面安装
- linux power state
- linux-cut 命令详解!
- linux:/用户/.bashrc 保存别名永久生效