1606: nc与滴水问题

Time Limit: 1000 MS  Memory Limit: 64 MB
Submit: 85  Solved: 27
[Submit][Status][Web Board]

Description

nc最近很无聊~所以他总是想各种有趣的问题来打发时间。
nc的宿舍水龙头在漏水,他只好拿一个水桶去接水,他很好奇至少过多久这个水桶会装满水。已知水桶是圆柱体,底面直径为D,高为H;又知道水龙头每K秒会滴下一滴水滴,我们假设水滴为球体,其半径为R。由于nc很懒,你需要帮他计算出至少过多久水桶里可以装满水。

Input

第一行为T。表示有T组数据。
以下T行,每行有4个整数D,H,K,R。(1<=D,H,K,R<=10^9)。

Output

输出T行。
每行一个整数,表示水桶装满水的时间。

Sample Input

2
16 9 1 3
6 9 2 2

Sample Output

16
16

HINT

 

Source

[Submit][Status][Web Board]

题目链接:

  http://acm.xmu.edu.cn/JudgeOnline/problem.php?id=1606

题目大意:

  有一个圆柱体水桶底面直径为D,高为H,水龙头每K秒会滴下一滴水滴,水滴为球体,半径为R,问多久水桶装满水

题目思路:

  【模拟】

  这题就数学公式算一下水桶体积和水滴的体积。然后除一下就好。

  注意double的精度可能会有误差。

  还有这题是只进不舍

 /****************************************************

     Author : Coolxxx
Copyright 2017 by Coolxxx. All rights reserved.
BLOG : http://blog.csdn.net/u010568270 ****************************************************/
#include<bits/stdc++.h>
#pragma comment(linker,"/STACK:1024000000,1024000000")
#define abs(a) ((a)>0?(a):(-(a)))
#define lowbit(a) (a&(-a))
#define sqr(a) ((a)*(a))
#define mem(a,b) memset(a,b,sizeof(a))
const double EPS=1e-;
const int J=;
const int MOD=;
const int MAX=0x7f7f7f7f;
const double PI=3.14159265358979323;
const int N=;
using namespace std;
typedef long long LL;
double anss;
LL aans;
int cas,cass;
int n,m,lll,ans;
int e[N][N],f[N][N];
void floyd()
{
int i,j,k;
for(k=;k<=n;k++)
{
for(i=;i<=n;i++)
{
if(i==k)continue;
for(j=;j<=n;j++)
{
if(i==j || k==j)continue;
f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
}
}
}
}
int main()
{
#ifndef ONLINE_JUDGE
// freopen("1.txt","r",stdin);
// freopen("2.txt","w",stdout);
#endif
int i,j,k,l;
int x,y,z;
for(scanf("%d",&cass);cass;cass--)
// for(scanf("%d",&cas),cass=1;cass<=cas;cass++)
// while(~scanf("%s",s))
// while(~scanf("%d",&n))
{
LL K;
double D,H,R;
scanf("%lf%lf%lld%lf",&D,&H,&K,&R);
double V=sqr(D/)*H;
double T=V/R/R/R/*;
LL t=LL(T);
if(T>t)t++;
t=t*K;
printf("%lld\n",t);
}
return ;
}
/*
// //
*/

最新文章

  1. Codeforces Round #361 (Div. 2) C
  2. Shell脚本一枚
  3. android最常用的退出方法
  4. oracle 数据库学习3 --oracle 数据库中常使用的函数
  5. Atitit intellij idea的使用总结attilax
  6. hibernate的Criteria条件查询
  7. css透明度的兼容!!!
  8. Initialize the Storage Emulator by Using the Command-Line Tool
  9. HTML5&amp;CSS3经典动态表单-2
  10. 写好的mapreduce程序,编译,打包,得到最后的jar包! 验证jar包 ! 整体流程
  11. sqlserver中关于merge
  12. North North West
  13. C#解leetcode 219. Contains Duplicate II
  14. centos6.5 Eclipse C/C++开发环境及项目创建测试
  15. CentOS 7.x 防火墙开放端口相关用法记录
  16. Web安全之XSS Platform搭建及使用实践
  17. 腾讯云快速完成python3.6开发环境搭建与django应用部署
  18. Windows 10 的有趣快捷键
  19. iframe父子元素获取
  20. sudo apt-get update 去除设置的代理

热门文章

  1. 基本Sql语句汇总
  2. CentOS 7中设置PHP7的Log文件日志
  3. linux 在当前目录下查找一个,或者多个文件
  4. maven+Hibernate+mysql环境搭建
  5. 为应用指定多个struts配置文件
  6. 一、SQL基础知识点补充
  7. 如何解决安装istio后istioctl命令每次使用都需要重新配置路径
  8. c# 类如何生成dll文件及引用
  9. BGP路由属性详解
  10. Vim pre-work