题目大意:给出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的更多相关文章

  1. POJ 2418 Hardwood Species

                                                     Hardwood Species Time Limit: 10000MS   Memory Limit ...

  2. Hardwood Species 分类: POJ 树 2015-08-05 16:24 2人阅读 评论(0) 收藏

    Hardwood Species Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 20619 Accepted: 8083 De ...

  3. Hardwood Species(水)

    Time Limit:10000MS    Memory Limit:65536KB    64bit IO Format:%I64d & %I64u SubmitStatus Descrip ...

  4. POJ2418——Hardwood Species(map映射)

    Hardwood Species DescriptionHardwoods are the botanical group of trees that have broad leaves, produ ...

  5. 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 ...

  6. [ACM] POJ 2418 Hardwood Species (Trie树或map)

    Hardwood Species Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 17986   Accepted: 713 ...

  7. POJ2418 Hardwood Species—二叉查找树应用

    1. Hardwood Species原题描述   Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 14326   Acce ...

  8. POJ 之 Hardwood Species

                                                         Hardwood Species Time Limit:10000MS     Memory ...

  9. [字典树] poj 2418 Hardwood Species

    题目链接: id=2418">http://poj.org/problem?id=2418 Hardwood Species Time Limit: 10000MS   Memory ...

随机推荐

  1. FTP 7.5 自定义扩展功能

    @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...

  2. PAT1001

    时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B Calculate a + b and output the sum in standard format 计算a+b ...

  3. PHP 常识

    PHP常识 1.谈谈你对MVC的认识,介绍几种目前比较流行的框架 由Model(M),View(V),Cntroller(C) 组成的一种设计模式,Model 主要处理一些业务处理类,View是页面显 ...

  4. 关于tomcat配置MyEclipse项目的配置代码

    例如:<Context path="/shis" docBase="E:\Genuitec\Workspaces\MyEclipse 8.6\zwfw_platfo ...

  5. CentOS 安装Chrome

    yum install http://people.centos.org/hughesjr/chromium/6/x86_64/RPMS/chromium-31.0.1650.63-2.el6.x86 ...

  6. Android PopupWindow的使用技巧(转)

    Android PopupWindow的使用技巧 PopupWindow是Android上自定义弹出窗口,使用起来很方便. PopupWindow的构造函数为 public PopupWindow(V ...

  7. 转:从web三层架构解析软件测试内容

    B/S架构的系统,都会使用如下的基础软件架构: 数据访问层:实现对数据的访问功能,如增加.删除.修改.查询数据. 业务逻辑层:实现业务的具体逻辑功能,如学生入学.退学.成绩管理等. 页面显示层:将业务 ...

  8. PAT (Advanced Level) 1059. Prime Factors (25)

    素因子分解. #include<iostream> #include<cstring> #include<cmath> #include<algorithm& ...

  9. dedecms 的这个dede:arclist里怎么调用全局变量?

    将{dede:global.cfg_templets_skin/} 写为 [field:global.cfg_templets_skin/] 即可.

  10. Spring中引入其他配置文件

    一.引入其他 模块XML 在Spring的配置文件,有时候为了分模块的更加清晰的进行相关实体类的配置. 比如现在有一个job-timer.xml的配置 <?xml version="1 ...