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 ...
随机推荐
- TableViewController的添加,删除,移动
#import "RootTableViewController.h" @interface RootTableViewController () { UITableViewCel ...
- [转]前端利器:SASS基础与Compass入门
[转]前端利器:SASS基础与Compass入门 SASS是Syntactically Awesome Stylesheete Sass的缩写,它是css的一个开发工具,提供了很多便利和简单的语法,让 ...
- VS2012编译错误信息,错误列表却没显示
今天在写代码的时候,发现VS有编译错误,在错误列表里面却没有显示错误信息,百思不得其解. 后来终于发现,错误列表弄了个筛选,所以就看不到错误信息了,晕死.有遇到该问题的,可以参考下.
- 开源语音识别系统 Simon
http://www.lupaworld.com/proj.php?mod=view&cid=&id=824 语音识别系统 Simon:Simon 是一个开源的语音识别系统,它不仅可以 ...
- GDOI模拟赛Round 1
GDOI模拟赛Round 1 数据结构 题目描述:给出一个长度为\(n\)的序列,支持两种操作: 1.对某段区间都加上一个数 2.给出\(p.k\),求下面表示式对\((10^9+7)\)取模 \[\ ...
- CAD 致命错误
在用.net进行CAD二次开发的时候,偶尔会出现致命错误,经总结,发现有两点会引起致命错误,在此记下,一来供自己参考,二来与大家分享 : ) 致命错误一: 描述:声明了DBObject对象,但未将对象 ...
- 当MVC4无法跳转时
//RedirectToAction("Index","首页"); //return View("首页/Index"); //Redirec ...
- 解读机器学习基础概念:VC维的来龙去脉 | 数盟
http://dataunion.org/14581.html
- C++ 数据结构学习二(单链表)
模板类 //LinkList.h 单链表#ifndef LINK_LIST_HXX#define LINK_LIST_HXX#include <iostream>using namespa ...
- char str[] 与 char *str的区别详细解析
char* get_str(void) { char str[] = {"abcd"}; return str; } char str[] = {"abcd"} ...