题目链接

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3866

思路

积分

参考博客

https://blog.csdn.net/u012377575/article/details/45285895

AC代码

#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <numeric>
#include <sstream>
#include <iomanip>
#include <limits> #define CLR(a) memset(a, 0, sizeof(a))
#define pb push_back using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair<string, int> psi;
typedef pair<string, string> pss; const double PI = acos(-1);
const double E = exp(1);
const double eps = 1e-30; const int INF = 0x3f3f3f3f;
const int maxn = 5e4 + 5;
const int MOD = 1e9 + 7; int main()
{
int T;
cin >> T;
while (T--)
{
int r, h, d;
scanf("%d%d%d", &r, &h, &d);
double v = (r + d) * (r + d) * PI * h + 2 * (2.0 / 3 * d * d * d * PI + r * d * d * PI * PI * 1.0 / 2 + r * r * d * PI);
double s = 2 * (r + d) * PI * h + 2 * PI * r * r + 2 * (PI * PI * r * d + 2 * PI * d * d);
printf("%.12lf %.12lf\n", v, s);
}
}

ZOJ - 3866 Cylinder Candy 【数学】的更多相关文章

  1. ZOJ 3866 - Cylinder Candy

    3866 - Cylinder Candy Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu ...

  2. zoj 3866

    G - Cylinder Candy Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Su ...

  3. Cylinder Candy(积分+体积+表面积+旋转体)

    Cylinder Candy Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Edward the confectioner is ...

  4. Cylinder Candy(积分)

    Cylinder Candy Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Edward the confectioner is ...

  5. ZOJ 1494 Climbing Worm 数学水题

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=494 题目大意: 一只蜗牛要从爬上n英寸高的地方,他速度为u每分钟,他爬完u需要 ...

  6. 【ZOJ 3897】Candy canes//Fiddlesticks

    题 题意 给你一串数,a1...an,从左到右每次让一个数减小c,如果这个数小于c,那就减为0.第n个数减小后,又从第一个开始从左到右.如果这次某个数减小到0,那就改变方向,如果遇到已经是0的,就跳过 ...

  7. zoj.3868.GCD Expectation(数学推导>>容斥原理)

    GCD Expectation Time Limit: 4 Seconds                                     Memory Limit: 262144 KB    ...

  8. hdu 4465 Candy 数学

    思路:易知结果为 ∑(n-k)*C(n+k,k)*(p^(n+1)*q^k+q^(n+1)*p^k). 注意不能直接算,注意点技巧!!!看代码 代码如下: #include<iostream&g ...

  9. ZOJ 3903 Ant(数学,推公示+乘法逆元)

    Ant Time Limit: 1 Second      Memory Limit: 32768 KB There is an ant named Alice. Alice likes going ...

随机推荐

  1. sudo如何保持当前用户的环境变量?

    现象,我在/etc/profile里设置全局代理,然后使用命令 1.curl http://www.baidu.com  走代理 2.sudo curl http://www.baidu.com 并没 ...

  2. VS2010 MFC中 使用CListCtrl的排序功能

    list 控件是creat的,不是拖在对话框上的.想使用CListCtrl的排序功能却犯了愁~~~ 还好找到方法,如下: .h文件里:afx_msg void OnLvnColumnclickList ...

  3. RTC实时时钟驱动

    RTC(Real-Time Clock)实时时钟为操作系统提供了一个可靠的时间,并且在断电的情况下,RTC实时时钟也可以通过电池供电,一直运行下去. RTC通过STRB/LDRB这两个ARM指令向CP ...

  4. span设置padding无效

    <span style="display:inline-block;padding-top:10px">测试<span> 给span加属性 display: ...

  5. &lt;LeetCode OJ&gt; 83. Remove Duplicates from Sorted List

    83. Remove Duplicates from Sorted List Total Accepted: 94387 Total Submissions: 264227 Difficulty: E ...

  6. 转载:JAVA中获取项目文件路径

    本文转载自:http://blog.163.com/michaelgaoit%40126/blog/static/11389538620103711613620/ web 上运行 1:this.get ...

  7. 记一个发HTML格式邮件的问题

    很早做了一个自动发邮件的程序,前一向发现Notes升级后反而CSS样式都没有了. 起初不以为意,反正格式数据在,客户也没说啥,后来觉得这样的态度要不得,小洞不补,大洞吃苦. 于是查查资料,发现浏览器里 ...

  8. Win7如何自定义鼠标右键菜单 添加在此处打开CMD窗口

    将下面文件保存为"右键添加在此处打开CMD窗口.reg"双击导入运行即可 Windows Registry Editor Version 5.00 [HKEY_CLASSES_RO ...

  9. AutoCAD 样条曲线如何结束

    如下所示,走了四个点之后曲线绘制结束想要闭合了   鼠标右击选择确认   然后变成下面这个样子,鼠标再右击就可以结束(然后又回从下面伸出来东西,还是右击)总之就是想要结束的时候:右击确认,不断右击   ...

  10. Intellij IDEA 的使用

    前言: 为什么我要选择intellij idea呢?原因有三 1.曾经公司的项目 在myeclipse10中不稳定 myeclipse说不定什么时候就崩溃卡死了  而intellij非常稳定 2.界面 ...