hdu 1004 Let the Balloon Rise(STL)
2015-08-12 13:09
405 查看
1代码:
#include<set> #include<string> #include<cstring> #include<cstdio> #include<iostream> using namespace std; set<string> st; multiset<string> mst; int main() { int n; string s; while(scanf("%d",&n)&&n) { st.clear(); mst.clear(); for(int i=0; i<n; i++) { cin>>s; st.insert(s); mst.insert(s); } set<string>::iterator it; int maxx=-1; for(it=st.begin(); it!=st.end(); it++) { int cnt=mst.count(*it); if(cnt>maxx) { maxx=cnt; s=*it; } } cout<<s<<endl; } return 0; }
相关文章推荐
- play.exceptions.TemplateExecutionException: Expecting a stack map frame 错误处理
- 互联网流媒体内容分发方式概述
- 算法思想篇(1)————枚举算法
- 自动布局 入门–Auto Layout
- springMVC框架搭建
- 配置LVS+keepalived 高可用负载均衡集群
- 百度面试题
- 黑马程序员——java集合Collection(单列集合)、Map(双列)
- 社交产品后端架构设计
- linux平台下Oracle database的安装与/etc/redhat-release
- HttpURLConnection&HttpClient网络通信
- leetcode 104: Maximum Depth of Binary Tree
- 总结------历时14个下午完成的安卓软件
- 8.12笔记 retrofit超时设置,studio 修改 Lint Error Checking
- 续上 编写Servlet查询数据库,列出员工信息列表
- java对于微信平台语音接收以及处理,语音下载以及arm格式转换MP3
- Mongodb 复制集Replica Set搭建与测试
- Hyper-V 中遇到错误 'vm' could not initialize
- 社交产品后端架构设计
- Quartz原理分析