题意: 插座插空问题

水题.....只要知道最后一个不需要插即可....

直接贴代码..

AC代码:

#include <iostream>
using namespace std;
int main()
{
int a,b,s,n,k;
cin>>n;
while(n--)
{
s=0;
cin>>a;
k=a;
while(a--)
{
cin>>b;
s+=b;
}
cout<<s-k+1<<endl;
}
return 0;
}

hdu 2304的更多相关文章

  1. HDOJ(HDU) 2304 Electrical Outlets(求和、、)

    Problem Description Roy has just moved into a new apartment. Well, actually the apartment itself is ...

  2. HDU——PKU题目分类

    HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...

  3. [转] HDU 题目分类

    转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...

  4. HDU ACM 题目分类

    模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...

  5. HDU 5643 King's Game 打表

    King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...

  6. 转载:hdu 题目分类 (侵删)

    转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...

  7. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  8. 【HDU 3037】Saving Beans Lucas定理模板

    http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...

  9. hdu 4859 海岸线 Bestcoder Round 1

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...

随机推荐

  1. java使用json抛出org.apache.commons.lang.exception.NestableRuntimeException解决方案

    出现这个问题,说明缺少jar包,将下面的jar引入即可 commons-beanutils-1.8.3 commons-lang-2.6 (注:导入最新的 3.1 版本会继续报如下错误) common ...

  2. UVA - 1153 Keep the Customer Satisfied(贪心)

    UVA - 1153 Keep the Customer Satisfied Time Limit: 3000MS   Memory Limit: Unknown   64bit IO Format: ...

  3. Javascript中的onclick事件

    示例: <script type="text/javascript"> function onSubmit() { alert("保存数据"); } ...

  4. Python3.4+opencv3

    1.安装Python 3.4 for Windows 好的这好像没有什么可以说的 2.下载OpenCV 3和Numpy(OpenCV依赖Numpy库) 大家在这里就出了问题.如果使用直接使用pip i ...

  5. iOS 写入文件保存数据的方式

     在iOS开发过程中,不管是做什么应用,都会碰到数据保存的问题.将数据保存到本地,能够让程序的运行更加流畅,不会出现让人厌恶的菊花形状,使得用户体验更好.下面介绍一下数据保存的方式: 1.NSKeye ...

  6. windows+linux下jdk安装及java环境变量配置

    对于初学java的用户来说,可能第一件要做的事情就是安装jdk及配置环境,以下内容主要讲述windows及linux下jdk的安装以及环境变量的配置. 1.首先下载相应平台可用版本jdk安装文件,可以 ...

  7. 产生文件命令touch,echo,cat<<EOF>test,less,more,tail,head

    . 输出命令 echo,cat,管道(|),tee,重定向(>, >>)等 . 创建一个文件:用 touch.echo.cat.tee, 重定向(>, >>)等 [ ...

  8. delphi 托盘程序 转

    Delphi的托盘编程   .现在很多程序都用这个,比如傲游,迅雷等,主要代码如下: uses Windows, Messages, SysUtils, Variants, Classes, Grap ...

  9. CCF NOIP2015复赛获奖分数线及名额分配办法

                                                     CCF NOIP2015复赛获奖分数线及名额分配办法 中国计算机学会CCF NOI竞赛委员会.科学委员 ...

  10. C++类型转换[转]

    转自 http://www.cnblogs.com/goodhacker/archive/2011/07/20/2111996.html C风格的强制类型转换(Type Cast)很简单,不管什么类型 ...