HDU 4464 Browsing History
来源:互联网 发布:青岛方特梦幻王国知乎 编辑:程序博客网 时间:2024/04/30 11:18
Browsing History
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3404 Accepted Submission(s): 1927
Problem Description
One day when you are going to clear all your browsing history, you come up with an idea: You want to figure out what your most valued site is. Every site is given a value which equals to the sum of ASCII values of all characters in the URL. For example aa.cc has value of 438 because 438 = 97 + 97 + 46 + 99 + 99. You just need to print the largest value amongst all values of sites.
Things are simplified because you found that all entries in your browsing history are of the following format: [domain], where [domain] consists of lower-case Latin letters and “.” only. See the sample input for more details.
Things are simplified because you found that all entries in your browsing history are of the following format: [domain], where [domain] consists of lower-case Latin letters and “.” only. See the sample input for more details.
Input
There are several test cases.
For each test case, the first line contains an integer n (1 ≤ n ≤ 100), the number of entries in your browsing history.
Then follows n lines, each consisting of one URL whose length will not exceed 100.
Input is terminated by EOF.
For each test case, the first line contains an integer n (1 ≤ n ≤ 100), the number of entries in your browsing history.
Then follows n lines, each consisting of one URL whose length will not exceed 100.
Input is terminated by EOF.
Output
For each test case, output one line “Case X: Y” where X is the test case number (starting from 1) and Y is a number indicating the desired answer.
Sample Input
1aa.cc2www.google.comwww.wikipedia.org
Sample Output
Case 1: 438Case 2: 1728
Source
2012 Asia Chengdu Regional Contest
看起来应该是12年成都赛区的一道签到题吧。
水,不解释。
看起来应该是12年成都赛区的一道签到题吧。
水,不解释。
#include <stdio.h>#include <algorithm>#define N 105using namespace std;char s[N];int main(){ int n,c=1; while(scanf("%d",&n)>0) { int maxn=0; while(n--) { scanf("%s",s); int sum=0; for(int i=0;s[i]!='\0';i++) sum+=s[i]; maxn=max(maxn,sum); } printf("Case %d: %d\n",c++,maxn); } return 0;}
0 0
- hdu 4464 Browsing History
- hdu 4464 Browsing History
- Hdu 4464 Browsing History
- HDU-#4464 Browsing History
- HDU 4464 Browsing History
- HDU 4464 Browsing History
- HDU—— 4464 Browsing History
- HDU 4464 Browsing History(最大ASCII的和)
- Browsing History
- HDU-4464-Browsing History (2012 ACM/ICPC成都现场赛!)
- A - Browsing History
- 2012ICPC长春站 A Browsing History 【字符串】
- 2012ACM/ICPC成都赛区现场赛A题---Browsing History(hdu4464)
- hdu 4342 History repeat itself
- HDU 4342 History repeat itself
- HDU 4342 History repeat itself
- HDU 4342 - History repeat itself
- Safe Browsing
- padarray函数
- 为hadoop集群安装mapreduce
- 各种之设置文本的属性
- python 装饰器的函数式编程
- 引用framework 类别方法奔溃问题
- HDU 4464 Browsing History
- Bitmap,Drawable,byte间的相互转化
- Play on Words
- 励精图治---Concurrency---怎么测??
- 测试博客
- [Django入门知识浅介]Django框架里的MVC思想
- 正则表达式分组、断言
- mac下修改mysql的默认字符集为utf8
- python中单,双引号和三个双引号的区别