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 ...
随机推荐
- wifi diplasy流程介绍
转自:http://blog.csdn.net/dnfchan/article/details/8558552/ 另外一篇不错的参考文章:http://www.360doc.com/content/ ...
- Jquery自定义扩展方法(一)
jquery是一款流行的JS框架,自定义JS方法,封装到Jquery中,调用起来也挺方便的,怎么写Jquery扩展方法那,网上翻阅了一部分代码,其实也挺简单的: 方式一: (jQuery.fn.set ...
- VS2013 当前不会命中断点,还没有为该文档加载任何符号
方法一: 把ie的 调试 打开,然后调试的时候 会问你 是在新示例中打开 还是 当前示例,你选择当前的就行了.还有 建议你用 ie8.0的 开发者工具 调试 非常舒服 我已经 早就不用debuger ...
- hp,Qlogic,Brocade光纖卡查看方式
查看光纖卡類型 # lspci| grep Fibre 1. NHB棟 光纖卡brocade /sys/class/fc_host 查看光纖卡是否加載,若無,打驅動brocade_adapter_so ...
- java中 this 和super的用法
通过用static来定义方法或成员,为我们编程提供了某种便利,从某种程度上可以说它类似于C语言中的全局函数和全局变量.但是,并不是说有了这种便利,你便可以随处使用,如果那样的话,你便需要认真考虑一下自 ...
- OpenMesh 读写网格控制(读取写入纹理坐标,法向等)
OpenMesh读取网格默认是不自动读取obj网格中的法向,纹理坐标等信息的,写入网格同样也是.所以要读取(或写入)这些信息需要修改默认的选项. 先看一下其读写网格的函数 template<cl ...
- 如何设计一个优秀的API(转)
到目前为止,已经负责API接近两年了,这两年中发现现有的API存在的问题越来越多,但很多API一旦发布后就不再能修改了,即时升级和维护是必须的.一旦API发生变化,就可能对相关的调用者带来巨大的代价, ...
- Android学习网站
1 <老罗Android应用开发视频教程> http://www.mobiletrain.org/about/news/android_video2.html
- ubuntu中jdk已经安装,但是eclipse启动报错
问题描述 在ubuntu中,jdk已经正常安装,java_home变量已经配置,但是启动eclipse的时候还是弹出以下错误信息: A Java RunTime Environment (JRE) o ...
- T-SQL 高级查询
基本常用查询 --select select * from student; --all 查询所有 select all sex from student; --distinct 过滤重复 selec ...