Browsing History
来源:互联网 发布:我知这世界本如露水般 编辑:程序博客网 时间:2024/05/17 23:55
1000ms
1000ms
32768KB
64-bit integer IO format: %I64d Java class name: Main
Font Size:
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
题意概述:意思很简单,题目也很简单,之所以写这篇博客是因为想保持每日一篇博客的记录。
解题思路:没什么值得说的,简单的运算就可以了。
源代码:
#include<iostream>#include<string>using namespace std;int main(){ string S; int T,sum,R,num=1; while(cin>>T&&T) { R=0; while(T--) { sum=0; cin>>S; for(int i=0;i<S.size();++i)sum+=S[i]; if(R<sum)R=sum; } cout<<"Case "<<num<<": "<<R<<endl; num++; } return 0;}
- Browsing History
- hdu 4464 Browsing History
- hdu 4464 Browsing History
- A - 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的和)
- 2012ICPC长春站 A Browsing History 【字符串】
- 2012ACM/ICPC成都赛区现场赛A题---Browsing History(hdu4464)
- HDU-4464-Browsing History (2012 ACM/ICPC成都现场赛!)
- Safe Browsing
- history
- history
- history
- history
- TOMCAT安装路径千万不要有空格 > <
- uva 101
- ubuntu 日常使用(持续更新)
- android soundrecorder之三 录音流程及数据流向
- perl基本语言语法(与java,c#不同的地方积累)
- Browsing History
- Oracle--optimizer_mode
- MVC4 AJAX的简单实用方法
- Oracle 闪回特性(FLASHBACK DATABASE)
- 【流媒體】H264—MP4格式及在MP4文件中提取H264的SPS、PPS及码流
- linux workqueue
- 单例设计_懒汉式(延迟加载)
- WDM驱动inf模板
- 批量修改数据库某个字段的某些字符