UVa 10226 - Hardwood Species
题目大意:给出n棵树(有重复),统计每种树出现的频率。使用STL的map。
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <iomanip>
#include <algorithm>
using namespace std;
typedef map<string, int> msi; int main()
{
#ifdef LOCAL
freopen("in", "r", stdin);
#endif
int T;
scanf("%d", &T);
getchar();
string str;
getline(cin, str);
msi m;
while (T--)
{
int total = ;
m.clear();
while (getline(cin, str))
{
if (str[] == ) break;
total++;
m[str]++;
}
for (msi::iterator it = m.begin(); it != m.end(); it++)
cout << it->first << " " << fixed << setprecision() << it->second * 100.0 / total << endl;
if (T) printf("\n");
}
return ;
}
这个也是总是Submission error,结果未知...
UVa 10226 - Hardwood Species的更多相关文章
- POJ 2418 Hardwood Species
Hardwood Species Time Limit: 10000MS Memory Limit ...
- Hardwood Species 分类: POJ 树 2015-08-05 16:24 2人阅读 评论(0) 收藏
Hardwood Species Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 20619 Accepted: 8083 De ...
- Hardwood Species(水)
Time Limit:10000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatus Descrip ...
- POJ2418——Hardwood Species(map映射)
Hardwood Species DescriptionHardwoods are the botanical group of trees that have broad leaves, produ ...
- POJ 2418 ,ZOJ 1899 Hardwood Species - from lanshui_Yang
Description Hardwoods are the botanical group of trees that have broad leaves, produce a fruit or nu ...
- [ACM] POJ 2418 Hardwood Species (Trie树或map)
Hardwood Species Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 17986 Accepted: 713 ...
- POJ2418 Hardwood Species—二叉查找树应用
1. Hardwood Species原题描述 Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 14326 Acce ...
- POJ 之 Hardwood Species
Hardwood Species Time Limit:10000MS Memory ...
- [字典树] poj 2418 Hardwood Species
题目链接: id=2418">http://poj.org/problem?id=2418 Hardwood Species Time Limit: 10000MS Memory ...
随机推荐
- Apache2.4 137行 httpd-ahssl.conf
C:\Users\Administrator>E:\PHP\Apache24\bin\httpd.exe -w -n "apache2.4" -k startAH00526: ...
- 当浏览器窗体改变时,div跟着变动方法
$(function(){ resizeU(); $(window).resize(resizeU); }); function resizeU() { var divkuangH = $(windo ...
- apache禁止公网IP访问的配置
由于最近在配置负载均衡环境 外网使用Nginx做代理,分发到Apache服务器上,所以不希望Apache配置的服务被外网访问,只希望内网Nginx访问,所以只能使用局域网IP访问 配置方法: 打开Ap ...
- ural1037 Memory Management
Memory Management Time limit: 2.0 secondMemory limit: 64 MB Background Don't you know that at school ...
- android脚步---图片浏览
简单的图片浏览器,实现图像显示与点击切换下一张 首先在main.xml里面定义一个简单的线性布局容器. <?xml version="1.0" encoding=" ...
- jquery奇怪的问题
Jquery中 $("#data_table4 tr:eq(0)").after("<tr><td>" +result+data.row ...
- 转:创建编码的WebTest
创建编码的WebTest•通常,通过将现有的已记录Web测试转换为编码的Web测试来创建编码的Web测试.记录的Web测试以“Web测试编辑器”中可见的请求树开头.编码的Web测试是一个生成一系列We ...
- Eclipse开发Maven项目提示:程序包org.junit不存在解决方案
原因: 个人考虑产生此错误的原因是因为Eclipse中对于测试和开发的鉴定不明?Intellij中没有错误,因为Intellij对项目的管理就是同Maven结构的. 解决方案: 原来的junit的sc ...
- 简单三段式状态机实验1-SOS
一直想从一段式状态机切换到三段式状态机,从书上和网上不断搜寻三段式案例及方法,感觉很简单,就想拿之前做过的实验把一段式改成三段式,可是写起来并非那么简单,很棘手,改完后也没有成功,尤其状态机里面的计数 ...
- tinkphp5.0 traits 的引入
Traits引入 ThinkPHP 5.0开始采用trait功能(PHP5.4+)来作为一种扩展机制,可以方便的实现一个类库的多继承问题. trait是一种为类似 PHP 的单继承语言而准备的代码复用 ...