Codeforces Round #251 (Div. 2) A - Devu, the Singer and Churu, the Joker
水题
#include <iostream>
#include <vector>
#include <algorithm> using namespace std; int main(){
int n,d,t;
cin >> n >> d;
for(int i = ; i < n; ++ i){
cin >> t;
d-=t;
}
d-=(n-)*;
if(d < ) cout<<-<<endl;
else cout<<(n-)*+d/<<endl;
}
Codeforces Round #251 (Div. 2) A - Devu, the Singer and Churu, the Joker的更多相关文章
- Codeforces Round#251(Div 2)D Devu and his Brother
--你以为你以为的.就是你以为的? --有时候还真是 题目链接:http://codeforces.com/contest/439/problem/D 题意大概就是要求第一个数组的最小值要不小于第二个 ...
- Codeforces Round #251 (Div. 2) C. Devu and Partitioning of the Array
注意p的边界情况,p为0,或者 p为k 奇数+偶数 = 奇数 奇数+奇数 = 偶数 #include <iostream> #include <vector> #include ...
- Codeforces Round #251 (Div. 2) B. Devu, the Dumb Guy
注意数据范围即可 #include <iostream> #include <vector> #include <algorithm> using namespac ...
- Codeforces Round 251 (Div. 2)
layout: post title: Codeforces Round 251 (Div. 2) author: "luowentaoaa" catalog: true tags ...
- Codeforces 439 A. Devu, the Singer and Churu, the Joker
这是本人第一次写代码,难免有点瑕疵还请见谅 A. Devu, the Singer and Churu, the Joker time limit per test 1 second memory l ...
- Codeforces Round #258 (Div. 2) E. Devu and Flowers 容斥
E. Devu and Flowers 题目连接: http://codeforces.com/contest/451/problem/E Description Devu wants to deco ...
- Codeforces Round #258 (Div. 2)E - Devu and Flowers
题意:n<20个箱子,每个里面有fi朵颜色相同的花,不同箱子里的花颜色不同,要求取出s朵花,问方案数 题解:假设不考虑箱子的数量限制,隔板法可得方案数是c(s+n-1,n-1),当某个箱子里的数 ...
- Codeforces Round #366 (Div. 2) ABC
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...
- Codeforces Round #354 (Div. 2) ABCD
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/out ...
随机推荐
- Linux 通过os进程pid找到端口号
[root@xxxx conf]# netstat -lutpn|grep tcp /java tcp /java tcp /java tomcat 监听的一些端口
- 列出zip文件内全部内容 当前目录下的所有文件压缩成zip格式的文件(file.zip)
[root@ok Desktop]# zip -r image.zip ./*.jpg adding: 20161007_113743.jpg (deflated 0%) adding: 201610 ...
- C#的反射机制
using System; using System.Collections; using System.Collections.Generic; using System.IO; using Sys ...
- 重温WCF之WCF抛出异常的处理SOAP Fault(十二)
1.(服务端)抛出和(客户端)捕获SOAP Fault 当我们需要客户端获取到WCF服务端的抛出的异常的时候,使用FaultException类 WCF类库在System.ServiceModel命名 ...
- 重温WCF之数据契约中使用枚举(转载)(十一)
转载地址:http://www.zhuli8.com/wcf/EnumMember.html 枚举类型的定义总是支持序列化的.当我们定义一个新的枚举时,不必应用DataContract特性,就可以在数 ...
- JavaWeb学习之tomcat安装与运行、tomcat的目录结构、配置tomcat的管理用户、web项目目录、虚拟目录、虚拟主机(1)
1.tomcat安装与运行双击tomcat目录下的bin/startup.bat,启动之后,输入http://localhost:8080,出现安装成功的提示,表示安装tomcat成功 2.tomca ...
- jQuery Moblie 学习之page、button、theme、panel、listview、controlgroup、navbar等(一)
1.jQTouch jQTouch与jQuery Moblie十分相似,也是一个jQuery插件,同样也支持HTML页面标签驱动,实现移动设备视图切换效果.不同的是它是专为WebKit内核的浏览器打造 ...
- 使用python递归子目录处理日志文件
重要说明: (1)python使用4个空格进行层次缩进的(不是tab),在eclipse里面可以直接使用tab缩进,是因为eclipse会实时地将tab转成4个空格 (2)在eclipse中安装pyD ...
- phpcms v9实现wap单页教程
下面以添加“关于我们”这一单页为例作phpcms V9 wap手机门户添加单页的教程说明: 步骤一:复制phpcms\templates\default\wap下的maps.html,粘贴重命名为ab ...
- 把浏览器的私有模式添加到VS中
题记:在用VS进行Web开发的时候,常常希望VS的调试不会对浏览器造成固定的影响,那么使用浏览器的私有模式来启动就很有必要. 前几天SCOTT HANSELMAN分享了一个开发Web应用程序的小技巧, ...