acm pku 2418解题报告
2008-11-12 17:13
281 查看
这题用标准STL做十分简单,但是时间有点长,我的程序如下:
Source Code
Problem: 2418 | User: zhao999 | |
Memory: 440K | Time: 3063MS | |
Language: C++ | Result: Accepted |
#include <iostream> #include <map> #include<string> using namespace std; int count=0; int main () { map<string,int> mymap; map<string,int>::iterator it; string a; while(getline(cin,a)) { if(a.length()==0) break; mymap[a]++; count++; } for ( it=mymap.begin() ; it != mymap.end(); it++ ) { cout << (*it).first << " "; printf("%.4lf/n",100*(*it).second/(double)count); } return 0; }
相关文章推荐
- Sum - ACM PKU 1844 解题报告
- ACM pku 1007 解题报告(给像我一样的新手们的忠告)
- acm pku 1032 Parliament 解题报告
- ACM pku 1067 解题报告(威佐夫博奕(Wythoff Game))
- POJ 2418 Hardwood Species 解题报告
- acm pku 1423解题报告
- acm pku 2479解题报告
- ACM pku 1005 解题报告
- ACM pku 1004 解题报告
- acm pku 1321解题报告 棋盘问题
- Pku acm 2418 Hardwood Species 排序算法解题报告(六) ----二叉查找数(BST)
- ACM pku 1658 解题报告(另一种输入输出方式)
- ACM pku 1140 解题报告(Expanding Fractions )
- POJ - 2418 Hardwood Species解题报告(trie树的建立以及遍历)
- POJ 2418 解题报告
- acm pku 1128解题报告
- HDU1042解题报告
- 2013 Multi-University Training Contest 3 解题报告(更新中)
- POJ 3468 A Simple Problem with Integers 解题报告
- 顶嵌杯决赛瑞星工程师高质量解题报告(一)