A simple water problem

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)

Total Submission(s): 173    Accepted Submission(s): 112

Problem Description
Dragon is watching competitions on TV. Every competition is held between two competitors, and surely Dragon's favorite. After each competition he will give a score of either 0 or 1 for each competitor and add it to the total score of that competitor. The total
score begins with zero. Here's an example: four competitors with name James, Victoria, Penghu, and Digo. First goes a competition between Penghu and Digo, and Dragon enjoys the competition and draw both 1 score for them. Then there’s a competition between
James and Victoria, but this time Dragon draw 1 for Victoria and 0 for James. Lastly a competition between James and Digo is held, but this time Dragon really dislike the competition and give zeroes for each of them. Finally we know the score for each one:
James--0, Victoria--1, Penghu--1, Digo--1. All except James are the Winner!



However, Dragon's mom comes back home again and close the TV, driving Dragon to his homework, and find out the paper with scores of all competitors. Dragon's mom wants to know how many competition Dragon watched, but it's hard through the paper. Here comes
the problem for you, given the scores of all competitors, at least how many competitions had Dragon watched?
 
Input
The first line of input contains only one integer T(<=10), the number of test cases. Following T blocks, each block describe one test case.



For each test case, the first line contains only one integers N(<=100000), which means the number of competitors. Then a line contains N integers (a1,a2,a3,...,an).ai(<=1000000) means the score of i-th
competitor.
 
Output
Each output should occupy one line. Each line should start with "Case #i: ", with i implying the case number. Then for each case just puts a line with one integer, implying the competition at least should be watched by dragon.
 
Sample Input
1
3
2 3 4
 
Sample Output
Case #1: 5
 
Source
 

HDOJ 4974 A simple water problem的更多相关文章

  1. HDU 4974 A simple water problem(贪心)

    HDU 4974 A simple water problem pid=4974" target="_blank" style="">题目链接 ...

  2. hdu - 4974 - A simple water problem(贪心 + 反证)

    题意:N个队(N <= 100000),每一个队有个总分ai(ai <= 1000000),每场比赛比赛两方最多各可获得1分,问最少经过了多少场比赛. 题目链接:http://acm.hd ...

  3. 2014多校第十场1004 || HDU 4974 A simple water problem

    题目链接 题意 : n支队伍,每场两个队伍表演,有可能两个队伍都得一分,也可能其中一个队伍一分,也可能都是0分,每个队伍将参加的场次得到的分数加起来,给你每个队伍最终得分,让你计算至少表演了几场. 思 ...

  4. HDU-4974 A simple water problem

    http://acm.hdu.edu.cn/showproblem.php?pid=4974 话说是签到题,我也不懂什么是签到题. A simple water problem Time Limit: ...

  5. BZOJ 3489: A simple rmq problem

    3489: A simple rmq problem Time Limit: 40 Sec  Memory Limit: 600 MBSubmit: 1594  Solved: 520[Submit] ...

  6. ZOJ 3686 A Simple Tree Problem

    A Simple Tree Problem Time Limit: 3 Seconds      Memory Limit: 65536 KB Given a rooted tree, each no ...

  7. hdu4976 A simple greedy problem. (贪心+DP)

    http://acm.hdu.edu.cn/showproblem.php?pid=4976 2014 Multi-University Training Contest 10 1006 A simp ...

  8. HDU 5832 A water problem(某水题)

    p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...

  9. hdu 1757 A Simple Math Problem (乘法矩阵)

    A Simple Math Problem Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Ot ...

随机推荐

  1. Linux渗透+SSH内网转发

    http://www.jb51.net/hack/58514.html http://blog.chinaunix.net/uid-756931-id-353243.html http://blog. ...

  2. 官方原版Windows XP SP3(VOL)中文简体版ISO下载

    今天,向各位朋友推荐今年五月,由MSDN官方集成的XP With SP3专业VOL版.    文 件:Windows XP Professional with Service Pack 3 (x86) ...

  3. sscanf,sscanf_s及其相关使用方法

    #include<stdio.h> 定义函数 int sscanf (const char *str,const char * format,........); 函数说明   sscan ...

  4. Android中TextView中内容不换行的解决方法

    问题 如果新建的Android项目采用的Android 3.0以上的SDK,同时采用了 <style name="AppTheme" parent="@androi ...

  5. meta标签详解:源http://blog.csdn.net/kongjiea/article/details/17092413

    一.大众机型常用meta标签name的设置 1.name之viewport <meta name="viewport" content=""> 说明 ...

  6. Swift正在使用NSURLConnection异步下载同步(实例解析)

    原版的blog.转载请注明出处 http://blog.csdn.net/hello_hwc 一.同步异步两个概念 简单来讲.同步就是函数或者闭包(objective c中的block)运行完成才干返 ...

  7. linux下Ftp环境的搭建

      Ftp环境的搭建 1.ftp软件的安装 使用ssh远程连接linux系统,上传和下载一些文件,Ftp是不可少的 Ftp的安装很简单,远程登录系统后使用命令 yum list vsftpd 通过提示 ...

  8. Heibernate 入门笔记(一)---第一个demo

    最近在学heibernate,是看马士兵老师的视频学的,在这里总结一下,做点笔记.关于heibernate的优点,大家可以在网上 百度,这里不做赘述,直接讲怎么使用heibernate 步骤一:新建项 ...

  9. css--左右visibility建立 “collapse”值问题

    1.您可能已使用visibility一千次,最常用的是visible和hidden.它用来显示或隐藏元素. 有第三很少已使用的值它是collapse,在表格的行,列中使用有差异外,他和hidden的作 ...

  10. Flex发行2048游戏

    近来的2048像挺火的游戏.在公交车,吃.甚至还有人走在路上拿着手机在玩.之前我看我的同事们戏,我认为这是很天真,中移动太无聊了吧 到后面,他是在,我觉得真的很无聊,这时候,无聊的时候无聊,后来我想用 ...