ZOJ 3923 In the Rain(数学)
2016-03-08 19:25
316 查看
将雨的三个方向的速度合成成 水平的速度和垂直的速度,由于水平的受面永远是2*r*h,并且垂直的受面是2*PI*r*r 根据速度和时间可以求解
#include<iostream> #include<cstdio> #include<cmath> #include<functional> #include<set> #include <cstring> #include <string> #include <algorithm> #include <cstdlib> #include <queue> #include <set> #include <map> #include <stack> #include<cctype> #include<sstream> #include<vector> #include <ctime> using namespace std; #define sp system("pause") #define PI acos(-1.0) typedef long long ll; #define iin(x) scanf("%d",&x) #define mst(x,y) memset(x,y,sizeof(x)) #define pr(x) printf("%.10f\n",x) int main() { int t; cin >> t; while(t--) { double r,h,v,x0,dx,dy,dz; cin >> r >> h >> v >> x0 >> dx >> dy >> dz; dz = fabs(dz);dy = fabs(dy); double tim = fabs(x0 / v); v -= dx; v=fabs(v); //cout <<tim << endl; double dxy = sqrt(v * v + dy * dy); //cout <<v << endl; //cout << h << " " << r << " " << tim << endl; double sum = dxy * h * 2 * r * tim; //pr(sum); //dz = sqrt(dy * dy + dz * dz + v * v); //sum += h * PI * r * r; //pr(sum); sum += dz * PI * r * r * tim; //pr(sum); printf("%.10f\n",sum); } return 0; }
相关文章推荐
- 【Codeforces Round 345 (Div 2) B】【贪心 STL-set】Beautiful Paintings 安排顺序使得a[i]大于a[i-1]的i尽可能多
- Codeforces Round #345 (Div. 2) C (multiset+pair )
- freeswitch You must define a domain called * in your directory
- NSURLErrorDomain Code=-999
- PAT1003-Highest Price in Supply Chain
- Codeforces #345 Div2 B Beautiful Paintings 构造/结论
- HDU 5293 Tree chain problem [树链剖分+线段树+树形DP]
- codeforces 651B Beautiful Paintings (想法)
- codeforces 651B Beautiful Paintings【优先队列】
- 浅析AIDL的使用
- 开发错误记录2 .MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
- Send an email using Telnet
- HDU 4819 Mosaic(二维线段树)
- uva 10090 So you want to be a 2n-aire?
- main
- RTAI安装与配置
- codeforces 651B Beautiful Paintings
- Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
- Codeforces--630A--Again Twenty Five! (水题)
- Codeforces--630A--Again Twenty Five! (水题)