Let the Balloon Rise(map)
Let the Balloon Rise
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 91684 Accepted Submission(s): 34910
This year, they decide to leave this lovely job to you.
A test case with N = 0 terminates the input and this test case is not to be processed.
#include<stdio.h>
#include<map>
#include<string>
#include<string.h>
using namespace std;
map<string,int>mp;
int main(){
int N;
char s[],ans[];
while(~scanf("%d",&N),N){
mp.clear();
int temp=;
for(int i=;i<=N;i++){
scanf("%s",s);
mp[s]++;
//printf("mp[%s]=%d\n",s,mp[s]);
if(mp[s]>temp){
temp=mp[s];
strcpy(ans,s);
}
}
printf("%s\n",ans);
}
return ;
}
Let the Balloon Rise(map)的更多相关文章
- HDU 1004 Let the Balloon Rise map
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- Let the Balloon Rise <map>的应用
Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the ...
- HDU 1004 Let the Balloon Rise(map应用)
Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...
- Let the Balloon Rise map一个数组
Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the ...
- hdoj-1004-Let the Balloon Rise(map排序)
map按照value排序 #include <iostream> #include <algorithm> #include <cstring> #include ...
- HDU1004 Let the Balloon Rise(map的简单用法)
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
- HDU 1004 Let the Balloon Rise【STL<map>】
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- hdu 1004 Let the Balloon Rise strcmp、map、trie树
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- HDU 1004 Let the Balloon Rise(map的使用)
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1004 Let the Balloon Rise Time Limit: 2000/1000 MS (J ...
随机推荐
- schema://host[:port#]/path/.../[?query-string][#anchor]
1:http协议状态200 OK最常见的就是成功响应状态码200了, 这表明该请求被成功地完成,所请求的资源发送回客户端 302 Found重定向,新的URL会在response 中的Location ...
- java--工具方法
根据时间戳得到具体的时间: public static void main(String[] args) { SimpleDateFormat sdf = new SimpleDateFormat(& ...
- Unix/Linux环境C编程入门教程(20) 搭建基于Mac的 Xcode 与 QT 开发环境
1.启动 Vmware,如果没有 VMware 的同学,请看前面我们搭建 VMware 的视频 2.打开虚拟机以后,出现虚拟机界面 3 新建一个虚拟机 4 选择自定义,单击下一步 5 选择默认的 VM ...
- 使用kd-tree加速k-means
0.目录 前置知识 思路介绍 详述 1 确定h的中心点 2 算法步骤 java实现 1.前置知识 本文内容基于<Accelerating exact k-means algorithms wit ...
- poj2136
Vertical Histogram Time Limit ...
- Android 弹出通知Toast的使用
//官方帮助文档:http://wear.techbrood.com/guide/topics/ui/notifiers/toasts.html <LinearLayout xmlns:andr ...
- javascript高级知识点——继承
代码信息来自于http://ejohn.org/apps/learn/. 继承是如何工作的 function Person(){} function Ninja(){} Ninja.prototype ...
- jquery 获取当前元素的索引值
$("#lisa > li").mouseover(function(){ alert($("#lisa > li").length); alert ...
- sqlite3插入日期时间出错解决
正确写法 insert into hhf_records(RegistrationNumber,MachinesNumber,InDataTime,Flag,CType) values (11,1,d ...
- hdu 4681 string
字符串DP 题意:给你三个字符串a,b,c求字符串d的长度. 字符串d满足的要求:是a和b的公共子序列,c是它的子串. 定义dp1[i][j]表示a的第 i 位与b的第 j 位之前相同的子序列长度(包 ...