cf B. Number Busters
http://codeforces.com/contest/382/problem/B
题意:给你Aa,b,w,x,c,然后每经过1秒,c=c-1; 如果b>=x,b=b-x;否则 a=a-1,b=w-(x-b); 问经过多少秒c<=a;
#include <cstdio>
#include <cstring>
#include <algorithm>
#define ll __int64
using namespace std; ll a,b,w,x,c; int main()
{
while(scanf("%I64d%I64d%I64d%I64d%I64d",&a,&b,&w,&x,&c)!=EOF)
{
ll l=,r=;
if(c<=a)
{
printf("0\n");
continue;
}
b=w-b-;
while(l<r)
{
ll mid=(l+r)/;
ll aa=a-(b+mid*x)/w;
ll cc=c-mid;
if(cc<=aa) r=mid;
else l=mid+;
}
printf("%I64d\n",l);
}
}
cf B. Number Busters的更多相关文章
- xtu summer individual 6 B - Number Busters
Number Busters Time Limit: 1000ms Memory Limit: 262144KB This problem will be judged on CodeForces. ...
- CF#235E. Number Challenge
传送门 可以理解为上一道题的扩展板.. 然后我们就可以YY出这样一个式子 ${\sum_{i=1}^a\sum_{j=1}^b\sum_{k=1}^cd(ijk)=\sum_{i=1}^a\sum_{ ...
- CF: Long Number
题目链接 #include<iostream> #include<string> ...
- CF D. Number Of Permutations 排列
挺水的一道题~ 拿全排列随便乘一下就好了. #include <cstdio> #include <algorithm> #define N 300004 #define ll ...
- 小学四则运算生成器(Java) 刘少允,梁新男
github传送门 项目相关要求 使用 -n 参数控制生成题目的个数.(实现) 使用 -r 参数控制题目中数值(自然数.真分数和真分数分母)的范围.(实现) 生成的题目中计算过程不能产生负数.(实现) ...
- B. Lost Number【CF交互题 暴力】
B. Lost Number[CF交互题 暴力] This is an interactive problem. Remember to flush your output while communi ...
- CF - 392 C. Yet Another Number Sequence (矩阵快速幂)
CF - 392 C. Yet Another Number Sequence 题目传送门 这个题看了十几分钟直接看题解了,然后恍然大悟,发现纸笔难于描述于是乎用Tex把初始矩阵以及转移矩阵都敲了出来 ...
- CF#231DIV2:A Good Number
Let's call a number k-good if it contains all digits not exceeding k (0, ..., k). You've got a numbe ...
- CF 441E Valera and Number
CF 441E Description 一共执行\(k\)次,每次有\(p\%\)把\(x * 2\),有\((100 - p)\%\)把\(x + 1\).问二进制下\(x\)末尾期望\(0\)的个 ...
随机推荐
- 摄像头参数查看与调节 分类: C/C++ OpenCV 2014-11-08 18:13 138人阅读 评论(0) 收藏
cvGetCaptureProperty 获得视频获取结构的属性 double cvGetCaptureProperty( CvCapture* capture, int property_id ); ...
- HDU 1025 Constructing Roads In JGShining's Kingdom (DP)
Problem Description JGShining's kingdom consists of 2n(n is no more than 500,000) small cities which ...
- Building Tomcat7 source step by step---官方文档
Table of Contents Introduction Download a Java Development Kit (JDK) version 6 Install Apache Ant 1. ...
- URAL 1988 - Planet Ocean Landing【几何&三分答案】
[题意] 在一个星球(是一个球体)表面有一个飞机(坐标(x1,y1,z1),原点是星球中心),在空中有一个空间站(坐标(x2,y2,z2)),所有值均小于100,现在要使飞机与空间站相遇,飞机的速度是 ...
- C## 输出Hello world
首先新建一个项目 然后在文件D:\C##Obj\HelloWorld\HelloWorld\Program.cs using System; using System.Collections.Gene ...
- 1.PhotoShop缩小图片的三种方式
先声明,本人不是高前端的,若有不当或者不合理的地方,还望前端爱好者多多指教.此处只是留作个人记录备忘. PS中有三种缩小 1.视图缩小,那方法很多缩放工具.Ctrl+"-",导航器 ...
- 菜鸟学开店—最简收银POS系统
佳博打印机代理商淘宝店https://shop107172033.taobao.com/index.htm?spm=2013.1.w5002-9520741823.2.Sqz8Pf 在此店购买的打印机 ...
- Web性能压力测试之Webbench使用详解
Webbench是知名的网站压力测试工具,它是由Lionbridge公司(http://www.lionbridge.com)开发.Webbench能测试处在相同硬件上,不同服务的性能以及不同硬件上同 ...
- angular.js 简单的表达式
<!doctype html> <html> <head> <meta charset ="utf-8"> <script s ...
- Linux 关于解压
1.*.tar 用 tar –xvf 解压 2.*.gz 用 gzip -d或者gunzip 解压 3.*.tar.gz和*.tgz 用 tar –xzf 解压 4.*.bz2 用 bzip2 -d或 ...