[Codeforces667A]Pouring Rain(数学,几何)
2016-06-04 14:55
369 查看
题目链接:http://codeforces.com/contest/667/problem/A
题意:一个杯子里有水,一个人在喝并且同时在往里倒。问这个人能不能喝完,多久能喝完。
把相关变量都量化成高度来做简单。
题意:一个杯子里有水,一个人在喝并且同时在往里倒。问这个人能不能喝完,多久能喝完。
把相关变量都量化成高度来做简单。
/* ┓┏┓┏┓┃キリキリ♂ mind! ┛┗┛┗┛┃\○/ ┓┏┓┏┓┃ / ┛┗┛┗┛┃ノ) ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┃┃┃┃┃┃ ┻┻┻┻┻┻ */ #include <algorithm> #include <iostream> #include <iomanip> #include <cstring> #include <climits> #include <complex> #include <fstream> #include <cassert> #include <cstdio> #include <bitset> #include <vector> #include <deque> #include <queue> #include <stack> #include <ctime> #include <set> #include <map> #include <cmath> using namespace std; #define fr first #define sc second #define cl clear #define BUG puts("here!!!") #define W(a) while(a--) #define pb(a) push_back(a) #define Rlf(a) scanf("%lf", &a); #define Rint(a) scanf("%d", &a) #define Rll(a) scanf("%I64d", &a) #define Rs(a) scanf("%s", a) #define Cin(a) cin >> a #define FRead() freopen("in", "r", stdin) #define FWrite() freopen("out", "w", stdout) #define Rep(i, len) for(int i = 0; i < (len); i++) #define For(i, a, len) for(int i = (a); i < (len); i++) #define Cls(a) memset((a), 0, sizeof(a)) #define Clr(a, x) memset((a), (x), sizeof(a)) #define Full(a) memset((a), 0x7f7f, sizeof(a)) #define lrt rt << 1 #define rrt rt << 1 | 1 #define pi 3.14159265359 #define RT return #define lowbit(x) x & (-x) #define onenum(x) __builtin_popcount(x) typedef long long LL; typedef long double LD; typedef unsigned long long ULL; typedef pair<int, int> pii; typedef pair<string, int> psi; typedef map<string, int> msi; typedef vector<int> vi; typedef vector<LL> vl; typedef vector<vl> vvl; typedef vector<bool> vb; double d, h, v, e; int main() { // FRead(); cin >> d >> h >> v >> e; d /= 2; if(v / (pi * d * d) <= e) printf("NO\n"); else printf("YES\n%.10f", h / (v / (pi * d * d) - e)); RT 0; }
相关文章推荐
- 【STL源码剖析】__type_traits技法
- MongoDB:[HostnameCanonicalizationWorker] Failed to obtain address information for hostname
- AirlineTicket
- Codeforces AIM Tech Round (Div. 2) A. Save Luke
- Git!!Git!!Start Again^^基本用法
- 【STL源码剖析】__iterator_traits技法
- POJ1804Brainman
- 关于人工智能的幻想(十)实现的顺序
- [AI]cognitive business|cognitive thinking
- 使用NEH解决no-wait flowshop makespan问题 (源码)
- 缓存报错-初始化失败 - context initialization failed
- LeetCode--No.217--Contains Duplicate
- 解决StandardServer.await: create[localhost:8005]:错误
- HDU 1239 Calling Extraterrestrial Intelligence Again (素数)
- maven : Failed to execute goal org.apache.maven.plugin错误Generating project in Interactive mode提示解决方案
- Get One Valid parentheses Pair
- hdu 1022 Train Problem
- main方法写错导致的一个错误
- ex3_3 Equality constrains and unrestricted variables
- HDOJ 2457 DNA repair (AC自动机+DP)