题目传送门

 /*
水题:这题唯一要注意的是要用double,princess可能在一个小时之内被dragon赶上
*/
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <map>
using namespace std; const int MAXN = 1e4 + ;
const int INF = 0x3f3f3f3f; int main(void) //Codeforces Round #105 (Div. 2) B. Escape
{
//freopen ("B.in", "r", stdin); double vp, vd, t, f, c;
while (scanf ("%lf%lf%lf%lf%lf", &vp, &vd, &t, &f, &c) == )
{
if (vd <= vp) puts ("");
else
{
double cur = vp * t; double d = ;
int cnt = ;
while (cur < c)
{
if (cur + vp <= d + vd)
{
double time = (cur - d) / (vd - vp);
if (cur + time * vp >= c) break;
cur += vp * (time + (d + vd * time) / vd + f); d = ;
cnt++;
}
else
{
cur += vp; d += vd;
}
} printf ("%d\n", cnt);
}
} return ;
}

水题 Codeforces Round #105 (Div. 2) B. Escape的更多相关文章

  1. 水题 Codeforces Round #302 (Div. 2) A Set of Strings

    题目传送门 /* 题意:一个字符串分割成k段,每段开头字母不相同 水题:记录每个字母出现的次数,每一次分割把首字母的次数降为0,最后一段直接全部输出 */ #include <cstdio> ...

  2. 水题 Codeforces Round #299 (Div. 2) A. Tavas and Nafas

    题目传送门 /* 很简单的水题,晚上累了,刷刷水题开心一下:) */ #include <bits/stdc++.h> using namespace std; ][] = {" ...

  3. 水题 Codeforces Round #304 (Div. 2) A. Soldier and Bananas

    题目传送门 /* 水题:ans = (1+2+3+...+n) * k - n,开long long */ #include <cstdio> #include <algorithm ...

  4. 水题 Codeforces Round #303 (Div. 2) A. Toy Cars

    题目传送门 /* 题意:5种情况对应对应第i或j辆车翻了没 水题:其实就看对角线的上半边就可以了,vis判断,可惜WA了一次 3: if both cars turned over during th ...

  5. 水题 Codeforces Round #286 (Div. 2) A Mr. Kitayuta's Gift

    题目传送门 /* 水题:vector容器实现插入操作,暴力进行判断是否为回文串 */ #include <cstdio> #include <iostream> #includ ...

  6. 构造水题 Codeforces Round #206 (Div. 2) A. Vasya and Digital Root

    题目传送门 /* 构造水题:对于0的多个位数的NO,对于位数太大的在后面补0,在9×k的范围内的平均的原则 */ #include <cstdio> #include <algori ...

  7. 水题 Codeforces Round #306 (Div. 2) A. Two Substrings

    题目传送门 /* 水题:遍历一边先找AB,再BA,再遍历一边先找BA,再AB,两种情况满足一种就YES */ #include <cstdio> #include <iostream ...

  8. 水题 Codeforces Round #308 (Div. 2) A. Vanya and Table

    题目传送门 /* 水题:读懂题目就能做 */ #include <cstdio> #include <iostream> #include <algorithm> ...

  9. 水题 Codeforces Round #307 (Div. 2) A. GukiZ and Contest

    题目传送门 /* 水题:开个结构体,rk记录排名,相同的值有相同的排名 */ #include <cstdio> #include <cstring> #include < ...

随机推荐

  1. JS基础:正则表达式

    简介 正则表达式 (regular expression) 描述了一种字符串匹配的模式,可以用来检查一个字符串是否含有某种子串.将匹配的子串做替换或者从某个字符串中取出符合某个条件的子串等.在 JS ...

  2. tyvj1045 最大的算式

    描述 题目很简单,给出N个数字,不改变它们的相对位置,在中间加入K个乘号和N-K-1个加号,(括号随便加)使最终结果尽量大.因为乘号和加号一共就是N-1个了,所以恰好每两个相邻数字之间都有一个符号.例 ...

  3. MVC view页面需要多个model,复杂网页的处理

    需求描述 一个比较复杂的页面,界面中包含的元素数据来自于许多个有关联或者无关联的表,然后我们要做的就是将数据呈现在界面上. 10年前大概都是这么干的 直接写一个复杂的SQL语句,返回一个包含所需数据的 ...

  4. POJ训练计划

    POJ训练计划 Step1-500题 UVaOJ+算法竞赛入门经典+挑战编程+USACO 请见:http://acm.sdut.edu.cn/bbs/read.php?tid=5321 一.POJ训练 ...

  5. 洛谷—— P1690 贪婪的Copy

    https://www.luogu.org/problem/show?pid=1690 题目描述 Copy从卢牛那里听说在一片叫yz的神的领域埋藏着不少宝藏,于是Copy来到了这个被划分为个区域的神地 ...

  6. Unity3D 游戏引擎之C#使用Socket与HTTP连接server数据传输包

    近期比較忙.有段时间没写博客拉.近期项目中须要使用HTTP与Socket.雨松MOMO把自己这段时间学习的资料整理一下. 有关Socket与HTTP的基础知识MOMO就不赘述拉,不懂得朋友自己谷歌吧. ...

  7. 怎样用fiddler2捕获移动设备上的http或者https请求

    调试移动设备上的问题.看不到发送的请求和得到的响应是比較难过的,fiddler能够实现样的功能. 原理: 在PC上启动fiddler.将手持设备的网络代理改成fiddler. 这样全部的请求和响应都经 ...

  8. lua遍历目录

    require"lfs" function findindir (path, wefind, r_table, intofolder) for file in lfs.dir(pa ...

  9. openstack (4)---部署Glance镜像服务,Nova计算服务

    一.Glance Glance是Openstack项目中负责镜像管理的模块,其功能包括虚拟机镜像的查找.注册和检索等. Glance提供Restful API可以查询虚拟机镜像的metadata及获取 ...

  10. mysql 將時間戳直接轉換成日期時間

    from_unixtime()是MySQL裏的時間函數 Sql代碼 select uid,userid,username,email,FROM_UNIXTIME(addtime,'%Y年%m月%d') ...