水题 Codeforces Round #105 (Div. 2) B. Escape
/*
水题:这题唯一要注意的是要用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的更多相关文章
- 水题 Codeforces Round #302 (Div. 2) A Set of Strings
题目传送门 /* 题意:一个字符串分割成k段,每段开头字母不相同 水题:记录每个字母出现的次数,每一次分割把首字母的次数降为0,最后一段直接全部输出 */ #include <cstdio> ...
- 水题 Codeforces Round #299 (Div. 2) A. Tavas and Nafas
题目传送门 /* 很简单的水题,晚上累了,刷刷水题开心一下:) */ #include <bits/stdc++.h> using namespace std; ][] = {" ...
- 水题 Codeforces Round #304 (Div. 2) A. Soldier and Bananas
题目传送门 /* 水题:ans = (1+2+3+...+n) * k - n,开long long */ #include <cstdio> #include <algorithm ...
- 水题 Codeforces Round #303 (Div. 2) A. Toy Cars
题目传送门 /* 题意:5种情况对应对应第i或j辆车翻了没 水题:其实就看对角线的上半边就可以了,vis判断,可惜WA了一次 3: if both cars turned over during th ...
- 水题 Codeforces Round #286 (Div. 2) A Mr. Kitayuta's Gift
题目传送门 /* 水题:vector容器实现插入操作,暴力进行判断是否为回文串 */ #include <cstdio> #include <iostream> #includ ...
- 构造水题 Codeforces Round #206 (Div. 2) A. Vasya and Digital Root
题目传送门 /* 构造水题:对于0的多个位数的NO,对于位数太大的在后面补0,在9×k的范围内的平均的原则 */ #include <cstdio> #include <algori ...
- 水题 Codeforces Round #306 (Div. 2) A. Two Substrings
题目传送门 /* 水题:遍历一边先找AB,再BA,再遍历一边先找BA,再AB,两种情况满足一种就YES */ #include <cstdio> #include <iostream ...
- 水题 Codeforces Round #308 (Div. 2) A. Vanya and Table
题目传送门 /* 水题:读懂题目就能做 */ #include <cstdio> #include <iostream> #include <algorithm> ...
- 水题 Codeforces Round #307 (Div. 2) A. GukiZ and Contest
题目传送门 /* 水题:开个结构体,rk记录排名,相同的值有相同的排名 */ #include <cstdio> #include <cstring> #include < ...
随机推荐
- 搜索 比MySQL快10倍?这可能是目前AWS Aurora最详解读!
作者介绍 朱阅岸,中国人民大学博士,现供职于腾讯云数据库团队.研究方向主要为数据库系统理论与实现.新硬件平台下的数据库系统以及TP+AP型混合系统. 编者按 Aurora作为AWS云上的关系数据库 ...
- 【ZJOI2017 Round1练习】D7T1 graph(提答)
题意: n<=1000 m<=10000 思路:
- bootstrap删除模态框弹出并询问是否删除【通用删除模态框】
普通的询问是否删除的对话框比较low,可以利用bootstrap的模态框代替普通的对话框来实现删除. 效果: 点删除的时候弹出模态框询问是否删除,点确认的时候将需要删除的ID传到后台进行删除. 过程 ...
- winform总结6=>线程和委托的关系
基础类: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Sys ...
- PostgreSQL及PostGIS使用
基础知识 参考文档:http://www.postgis.net/docs/ PostGIS支持的GIS对象是OpenGIS Consortium(OGC)定义的“简单特征”的超集.OpenGIS规范 ...
- Redundant Paths-POJ3177(强连通缩点)
http://poj.org/problem?id=3177 题目大意:给你几个点和几条边 求你能加几条边 就可以让每一个点到达任意点都有两种方法. Description In order t ...
- 在 IIS 中承载 WCF 服务
本主题概述了创建 Internet 信息服务 (IIS) 中承载的 Windows Communication Foundation (WCF) 服务所需的基本步骤. 本主题假设您熟悉 IIS 且了解 ...
- poj 2318 TOYS & poj 2398 Toy Storage (叉积)
链接:poj 2318 题意:有一个矩形盒子,盒子里有一些木块线段.而且这些线段坐标是依照顺序给出的. 有n条线段,把盒子分层了n+1个区域,然后有m个玩具.这m个玩具的坐标是已知的,问最后每一个区域 ...
- Windows 7 SID 修改
在安裝Windows系統時會產生一個獨一無二的SID (Security ID),它用來識別每一部主機,若在同一個區域網路內有兩部相同SID的主機,會出現警告訊息.一般而言,每次安裝時的SID不可能會 ...
- js逻辑执行判断
两个变量或者函数,如果与的关系,a && b,如果a是真则在运行b,如果a是假则不运行b了:如果是或的关系,前者是真则不运行后边的了,否则反过来. 举个例子: <span cla ...