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 ...
随机推荐
- PAT (Advanced Level) 1106. Lowest Price in Supply Chain (25)
简单dfs #include<cstdio> #include<cstring> #include<cmath> #include<vector> #i ...
- C# 初步学习
这学期有了C#开发这门课....先做了计算器,还有进制转换,别人看来似乎很强,其实在ACM中算是两个简单的水题了.....参加竞赛一年下来,发现学到的算法和数据结构都是十分有用的东西. 计算器最核心的 ...
- 【转载】最全的面试题目整理(HTML+CSS部分)
转载自 知乎 @西点王子 https://www.zhihu.com/people/F211/answers 1. 常用那几种浏览器测试?有哪些内核(Layout Engine)? (Q1) 浏览器: ...
- Ubuntu 12.04和Windows 7双系统安装图解
http://wenku.baidu.com/link?url=PZlnNOhY0SjHDW-teFFnCMzPYJVjx7vj6yWY-o5HHFLuFqhLI4uFcQVu_y0_6i7vpSnz ...
- 优化のzen cart调用WordPress
zen cart调用wordpress博客系统文章的方法 zencart根目录下新建blog 解压wp进去然后 wp-admin 安装 数据库共用 之前将wordpress和zencart整合起来 是 ...
- Linux中java项目环境部署,简单记录一下
这里只是简单的记录一下linux环境下面如何快速的搭配好环境,使你的项目能在linux环境上面运行. 很多时候,我们都是用windows环境进行配置调试的,而真正很多服务器都是在linux服务器上面的 ...
- VS2010 C#调用C++ DLL文件
http://www.soaspx.com/dotnet/csharp/csharp_20110406_7469.html http://www.cnblogs.com/warensoft/archi ...
- 页面加载完毕执行多个JS函数
通常我们需要在打开页面时加载脚本,这些脚本必须在页面加载完毕后才可以执行,因为这时候DOM才完整,可以利用window.onload确保这一点,如:window.onload=firstFunctio ...
- ida dump内存脚本
auto i,fp; fp = fopen("d:\\dump.dex","wb"); for(i=r0;i<r0+0x20;i++) fputc(Byt ...
- mahout 查看kmeans结果的命令
$mahout seqdumper -i output/clusters-1/part-r-00000 直接在控制台上显示,要写入文件可以在后面加上-o <输出路径> mahout中的k ...