XMU 1606 nc与滴水问题 【模拟】
2024-09-02 05:35:26
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 2Sample Output
16
16HINT
Source
题目链接:
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 ;
}
/*
// //
*/
最新文章
- Codeforces Round #361 (Div. 2) C
- Shell脚本一枚
- android最常用的退出方法
- oracle 数据库学习3 --oracle 数据库中常使用的函数
- Atitit intellij idea的使用总结attilax
- hibernate的Criteria条件查询
- css透明度的兼容!!!
- Initialize the Storage Emulator by Using the Command-Line Tool
- HTML5&;CSS3经典动态表单-2
- 写好的mapreduce程序,编译,打包,得到最后的jar包! 验证jar包 ! 整体流程
- sqlserver中关于merge
- North North West
- C#解leetcode 219. Contains Duplicate II
- centos6.5 Eclipse C/C++开发环境及项目创建测试
- CentOS 7.x 防火墙开放端口相关用法记录
- Web安全之XSS Platform搭建及使用实践
- 腾讯云快速完成python3.6开发环境搭建与django应用部署
- Windows 10 的有趣快捷键
- iframe父子元素获取
- sudo apt-get update 去除设置的代理