hdu 1004 Let the Balloon Rise 解题报告
2024-10-20 20:36:48
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1004
用STL 中的 Map 写的
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <map>
using namespace std; map<string, int> ballon;
string tmp; int main()
{
int i, j, n;
while (cin >> n && n)
{
ballon.clear();
for (i = ; i < n; i++)
{
cin >> tmp;
ballon[tmp]++;
}
map<string, int>::iterator iter, poi;
int maxp = ;
for (iter = ballon.begin(); iter != ballon.end(); iter++)
{
if (maxp < iter->second)
{
maxp = iter->second;
poi = iter;
}
// cout << iter->first << " " << iter->second << endl;
}
cout << poi->first << endl;
}
return ; }
最新文章
- Entity Framework之IQueryable和list本地集合
- java 27 - 7 反射之 通过反射越过泛型检查
- HDU 5876 Sparse Graph BFS 最短路
- 使用Adivisor配置增强处理
- jquery中各个事件执行顺序如下:
- [访问系统] Api_Win32_Mac类工具包 (转载)
- J2EE ssm框架-服务启动项内存加载数据及读取。
- Getting Started with the NDK
- 基于basys2驱动LCDQC12864B的verilog设计图片显示
- Tensorflow之MNIST解析
- webpack分片chunk加载原理
- vue中使用stylus
- 【UOJ 351】新年的叶子
- js的style.display小问题
- SQLSERVER将数据移到另一个文件组之后清空文件组并删除文件组
- git push.default设置
- ZH奶酪:LAMP环境中如何重新部署一个Yii2.0 web项目
- idea svn 使用问题
- android动态设置边框颜色
- gcc/g++ 命令的常用选项
热门文章
- 提高速度 history 的利用
- http put/delete方式请求
- java判断日期与星期
- [__NSCFConstantString size]: unrecognized selector sent to instance 错误
- GOF23种设计模式-工厂模式
- python 依照list中的dic的某key排序
- vdWebControl.js去水印
- Spring Cloud(十二):Spring Cloud Zuul 限流详解(附源码)(转)
- 服务管理-DHCP、NTP、SSH
- Linux驱动经典面试题目