Time Limit: 5000MS Memory limit: 65536K

题目描写叙述

Haveyou ever played a popular game named "Fruit Ninja"?

Fruit Ninja (known as Fruit Ninja HD on the iPad and Fruit Ninja THD for NvidiaTegra 2 based Android devices) is a video game developed by Halfbrick. It wasreleased April 21, 2010 for iPod Touch and iPhone devices, July 12, 2010 forthe iPad, September 17, 2010 for Android OS devices. Fruit Ninja was wellreceived by critics and consumers. The iOS version sold over 200,000 copies inits first month. By March 2011 total downloads across all platforms exceeded 20million. It was also named one of Time magazine's 50 Best iPhone Apps of 2011.

"Swipeyour finger across the screen to deliciously slash and splatter fruit like atrue ninja warrior. Be careful of bombs - they are explosive to touch and willput a swift end to your juicy adventure!" - As it described onhttp://www.fruitninja.com/, in Fruit Ninja the player slices fruit with a bladecontrolled via a touch pad. As the fruit is thrown onto the screen, the player swipestheir finger across the screen to create a slicing motion, attempting to slicethe fruit in parts. Extra points are awarded for slicing multiple fruits withone swipe, and players can use additional fingers to make multiple slicessimultaneously. Players must slice all fruit; if three pieces of fruit aremissed the game ends. Bombs are occasionally thrown onto the screen, and willalso end the game should the player slice them.

Maybe you are an excellent player of Fruit Ninja, but in this problem we focus onsomething more mathematically. Consider a certain slicing trace you create onthe touch pad, you slice a fruit (an apple or a banana or something else) intotwo parts at once. Can you figure out the volume of each part?

Impossibletask? Let us do some simplification by define our own Fruit Ninja game.
In our new Fruit Ninja game, only one kind of fruit will be thrown into the air- watermelon. What's more, the shape of every watermelon is a special Ellipsoid(details reachable at http://en.wikipedia.org/wiki/Ellipsoid) that it's polarradius OC is always equals to it's equatorial radius OB. Formally, we can getthis kind of solid by revolving a certain ellipse on the x-axis. And theslicing trace the player created (represented as MN in Illustration III) is aline parallel to the x-axis. The slicing motion slice the watermelon into twoparts, and the section (shown as the dark part in Illustration III) is parallelto plane x-O-y.

Given the length of OA, OB, OM (OM is thedistance between the section and plane x-O-y), your task is to figure out thevolume of the bigger part.

输入

Thereare multiple test cases. First line is an integer T (T ≈ 100), indicating thenumber of test cases.

For each test case, there are three integers: a, b, H, corresponding the lengthof OA, OB, OM. You may suppose that0 < b <= a <= 100 and 0 <= H <= 100.

输出

Outputcase number "Case %d: " followed by a floating point number (round to3) for each test case.

演示样例输入

4

2 2 0

2 2 1

2 2 2

2 2 3

演示样例输出

Case 1: 16.755

Case 2: 28.274

Case 3: 33.510

Case 4: 33.510

时间紧急,图片处理的不是太好,大家将就看吧

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

刚看这个题目确实被吓到了,细致看了以后你会发现这就是一个高数上的三重积分的问题。

求椭球缺的体积參考:http://zhidao.baidu.com/link?url=VGl0sArergv86msYl9wilJwfMk29d--x2frRo0pNEkRoY7-3K2r5sbL-aR15Vcd_VwKLU2xpmEMFUgGVq7SI1K

椭球长半轴 a ,短半轴 b ,高 h,(h 就是 题中 的 h)

则椭球缺体积能够这样求:(Word 里的数学符号不能显示,截个图片吧)

PI 为圆周率

然后用这个体积加上半球的体积就OK了。。

公式: V = 2/3*PI*a*b*b+PI *a*(b*h—h^3/(3*b))

Code:

#include <iostream>
#include<stdio.h>
using namespace std;
const double PI =  3.14159265358;  //PI  = 3.1415926535  时 WA,所以注意精度
int main()
{int t,count = 1;;double a,b,h,V;scanf("%d",&t);while(t--){scanf("%lf%lf%lf",&a,&b,&h);if(h>=b)h = b;V = 2.0/3.0*PI*a*b*b+PI*a*b*h-PI*a*h*h*h/(3.0*b);printf("Case %d: ",count++);printf("%.3lf\n",V);}return 0;
}

Sdut 2416 Fruit Ninja II(山东省第三届ACM省赛 J 题)(解析几何)相关推荐

  1. 山东省第三届ACM省赛

    ID Title Hint A Impasse (+)   B Chess   C An interesting game 最小费用最大流 D n a^o7 !   E Fruit Ninja I d ...

  2. [2012山东ACM省赛] Fruit Ninja II (三重积分,椭球体积)

    Fruit Ninja II Time Limit: 5000MS Memory limit: 65536K 题目描述 Have you ever played a popular game name ...

  3. 山东省第八届 ACM 省赛 sum of power(SDUT 3899)

    Problem Description Calculate ∑ni=1im mod (1000000000+7) for given n,m. Input Input contains two int ...

  4. 2014山东省第五届ACM省赛

    现在只会做8题....ABCDEFGJ 题目在sdut 2877-2886 A. angry birds again and again 链接 http://acm.sdut.edu.cn/sduto ...

  5. 山东省第八届 ACM 省赛 Parity check (规律、水)

    Description Fascinated with the computer games, Gabriel even forgets to study. Now she needs to fini ...

  6. 山东省第五届ACM省赛题——Colorful Cupcakes(四维dp)

    题目描述 Beaver Bindu has N cupcakes. Each cupcake has one of three possible colors. In this problem we ...

  7. HDU - 5877 Weak Pair 2016 ACM/ICPC 大连网络赛 J题 dfs+树状数组+离散化

    题目链接 You are given a rootedrooted tree of NN nodes, labeled from 1 to NN. To the iith node a non-neg ...

  8. 2013 ACM/ICPC 长沙网络赛J题

    题意:一个数列,给出这个数列中的某些位置的数,给出所有相邻的三个数字的和,数列头和尾处给出相邻两个数字的和.有若干次询问,每次问某一位置的数字的最大值. 分析:设数列为a1-an.首先通过相邻三个数字 ...

  9. 2019河南省第十二届ACM省赛原题题目及省赛榜单

    题目 榜单 Rank Name Solved Time     A     B     C     D     E     F     G     H     I     J Total att/so ...

最新文章

  1. Nginx之location 匹配规则详解
  2. 解答MPLS基础的路由问题—Vecloud微云
  3. fsimage文件丢失_hadoop fsimage edits关系
  4. isamchk mysql_利用Myisamchk对MySQL数据表进行体检
  5. java-基础练习题3
  6. excel怎么设置打印区域_别再浪费打印纸了!这样设置,Excel表格再大都能打印成一页!...
  7. python输入字符串str_python字符串(str)
  8. eclipse theia_Eclipse的Theia发布,缺少KubeCon,还有更多行业趋势
  9. Android基础 淡入淡出、上下弹出动画的
  10. Scaling For iPad mini
  11. python抢小米6自动化脚本
  12. 英语句型之综合运用篇
  13. Python编程基础 一张图认识Python
  14. 深圳python培训学习班
  15. DML和DDL含义和区别
  16. [续]基于高斯两步移动搜寻法(2SFCA)的城市绿地可达性分析[格网]
  17. Vi编辑器的常用命令2(文件操作)
  18. 软件公司要咨询顾问干什么?
  19. MySQL8免安装版下载安装与配置(windows)
  20. “流言蜚语”中,前CEO直接套现20亿美元!

热门文章

  1. 实现isnum函数python_python 学习 实现isOdd函数 实现isNum()函数 实现multi() 实现isPrime() 格式化输出日期DAY16...
  2. dplayer js控制 自动全屏_vue 中使用video.js 实现m3u8视频播放格式
  3. Proxmark3 Easy Gui 4.0 5.0 5.1加强版免费获取啦
  4. Linux查看网卡,重启网卡,查看网络数据的方法
  5. 智能一代云平台(五):移动开发之环境搭建
  6. 波士顿动力十年对比刷屏,网友:以后该不会变成终结者吧?
  7. 赠票福利 | 2018人工智能计算大会报名开启:算力爆燃,AI进化
  8. 苹果架构调整:AI、机器学习和Siri合并,由前谷歌AI负责人领导
  9. 英伟达为全自动驾驶汽车打造AI计算机,计算力达上代10倍
  10. 高阶函数 map,reduce, filter的用法