cf B. Number Busters
2024-09-12 23:59:00
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);
}
}
最新文章
- Model Validation in ASP.NET Web API
- C# EF增删改查
- Shanghai Regional Online Contest 1004
- JSON字符串和对象之间的转换
- 【WPF】Winform调用WPF窗体注意事项
- zookeeper监控告警
- Ubuntu安装samba服务器
- beforefieldinit释义(2)
- 解读QML之三
- javascript中构造StringBuffer实例
- 设计模式-策略模式(strategy pattern)
- UWP中实现大爆炸效果(二)
- Win 10中使用图片查看器
- 图解CSS3核心技术与案例实战(1)
- MachineLN博客目录
- JMeter采用NON GUI模式时如何记录并查看错误
- SWD and JTAG selection mechanism
- spring定时任务详解(@Scheduled注解)多线程讲解
- vue 混入的理解
- ruby md5 sha1 base64加密