Fruit Ninja II

Time Limit: 5000MS Memory limit: 65536K

题目描述

Have you ever played a popular game named "Fruit Ninja"?

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

"Swipe your finger across the screen to deliciously slash and splatter fruit like a true ninja warrior. Be careful of bombs - they are explosive to touch and will put a swift end to your juicy adventure!" - As it described on http://www.fruitninja.com/, in Fruit Ninja the player slices fruit with a blade controlled via a touch pad. As the fruit is thrown onto the screen, the player swipes their finger across the screen to create a slicing motion, attempting to slice the fruit in parts. Extra points are awarded for slicing multiple fruits with one swipe, and players can use additional fingers to make multiple slices simultaneously. Players must slice all fruit; if three pieces of fruit are missed the game ends. Bombs are occasionally thrown onto the screen, and will also end the game should the player slice them.

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

Impossible task? 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 polar radius OC is always equals to it's equatorial radius OB. Formally, we can get this kind of solid by revolving a certain ellipse on the x-axis. And the slicing trace the player created (represented as MN in Illustration III) is a line parallel to the x-axis. The slicing motion slice the watermelon into two parts, and the section (shown as the dark part in Illustration III) is parallel to plane x-O-y.

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

输入

There are multiple test cases. First line is an integer T (T ≈ 100), indicating the number of test cases.

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

输出

Output case number "Case %d: " followed by a floating point number (round to 3) 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

提示

 In case 4, H is larger than b, which simply represent a miss.

http://www.fruitninja.com/
http://en.wikipedia.org/wiki/Fruit_Ninja
http://en.wikipedia.org/wiki/Ellipsoid

来源

 2012年"浪潮杯"山东省第三届ACM大学生程序设计竞赛

 
  数学题
  运用高数中的三重积分演算出求椭圆台的体积公式。然后直接套公式过。
  模拟赛的时候是帅爷做出来的,唉,高数不好的孩子只能远远的看着啊!数学真的很重要,有时间一定要好好补补。
  注意OM>=OB的情况,不需要计算椭圆台的体积,直接输出整个椭圆球体的体积。
  代码:
 #include <iostream>
#include <stdio.h>
#include <cmath>
const double PI = acos(-);
using namespace std; int main()
{
int T;
cin>>T;
for(int i=;i<=T;i++){
double a,b,m;
cin>>a>>b>>m;
double Vsum = *PI*a*b*b//;
double Vsma = PI*a*b*(m-m*m*m/(*b*b));
if(m>=b)
printf("Case %d: %.3lf\n",i,*Vsum);
else
printf("Case %d: %.3lf\n",i,Vsum+Vsma);
}
return ;
} /**************************************
Problem id : SDUT OJ J
User name : Miracle
Result : Accepted
Take Memory : 540K
Take Time : 0MS
Submit Time : 2014-04-27 11:53:58
**************************************/

Freecode : www.cnblogs.com/yym2013

sdut 2416:Fruit Ninja II(第三届山东省省赛原题,数学题)的更多相关文章

  1. sdut 2411:Pixel density(第三届山东省省赛原题,字符串处理)

    Pixel density Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Pixels per inch (PPI) or pi ...

  2. SDUT 2416:Fruit Ninja II

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

  3. Sdut 2416 Fruit Ninja II(山东省第三届ACM省赛 J 题)(解析几何)

    Time Limit: 5000MS Memory limit: 65536K 题目描述 Haveyou ever played a popular game named "Fruit Ni ...

  4. sdut 2413:n a^o7 !(第三届山东省省赛原题,水题,字符串处理)

    n a^o7 ! Time Limit: 1000MS Memory limit: 65536K 题目描述 All brave and intelligent fighters, next you w ...

  5. sdut 2610:Boring Counting(第四届山东省省赛原题,划分树 + 二分)

    Boring Counting Time Limit: 3000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述     In this problem you a ...

  6. sdut 2163:Identifiers(第二届山东省省赛原题,水题)

    Identifiers Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述  Identifier is an important c ...

  7. sdut 2152:Balloons(第一届山东省省赛原题,DFS搜索)

    Balloons Time Limit: 1000MS Memory limit: 65536K 题目描述 Both Saya and Kudo like balloons. One day, the ...

  8. sdut 2153:Clockwise(第一届山东省省赛原题,计算几何+DP)

    Clockwise Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Saya have a long necklace with ...

  9. sdut 2154:Shopping(第一届山东省省赛原题,水题)

    Shopping Time Limit: 1000MS Memory limit: 65536K 题目描述 Saya and Kudo go shopping together.You can ass ...

随机推荐

  1. ci创建zip

    public function createZip() { $this->load->library("zip"); $name = "test.text&q ...

  2. php-5.3 zend opcache 的设置

    故障现象,修改了代码上传到生产服务器之后,需要等待60秒才生效. 细查了一下,是opcache引起的,默认是60秒.于是我给关了,之前是ea加速,现在新版本的php好像用这个opcache了:; 2s ...

  3. C# 反射创建对象,包括创建引用外部程序集类的实例

    #region 根据对象名成创建对象 /// <summary> /// 根据对象名成创建对象 /// </summary> /// <param name=" ...

  4. javax.inject中@Inject、@Named、@Qualifier和@Provider用法

    @Inject @Inject支持构造函数.方法和字段注解,也可能使用于静态实例成员.可注解成员可以是任意修饰符(private,package-private,protected,public).注 ...

  5. iOS多线程介绍

    一.线程概述 有些程序是一条直线,起点到终点:有些程序是一个圆,不断循环,直到将它切断.直线的如简单的Hello World,运行打印完,它的生命周期便结束了,像昙花一现那样:圆如操作系统,一直运行直 ...

  6. Java设计原则:面向接口的设计

    前言:在一个面向对象的系统中,系统的各种功能是由许许多多的不同对象协作完成的.在这种情况下,各个对象内部是如何实现对系统设计人员来说就不那么重要:而各个对象之间的协作关系则成为系统设计的关键.小到不同 ...

  7. 一个不安装Oracle客户端的方法------未经试验

    (一)不安装客户端的解决办法.第一种方法:1.在安装ORACLE服务器的机器上搜索下列文件,oci.dllocijdbc10.dllociw32.dllorannzsbb10.dlloraocci10 ...

  8. 寻虫记:BOM头制造的冤案,无故多出空白行

    最近在做的一个网站发生了一个很诡异的BUG: 使用IE浏览页面时,一切都挺正常: 而使用Firefox浏览时,发现某些页面元素之间的距离比预期的要宽很多,HTML元素本身的hight.padding和 ...

  9. linux下面覆盖文件,如何实现直接覆盖,不提示

    转自:http://w-tingsheng.blog.163.com/blog/static/2505603420124309130528/ cp覆盖时,无论加什么参数-f之类的还是提示是否覆盖,当文 ...

  10. apue第六章学习总结

    apue第六章学习总结 1.关于阴影文件与口令 在口令文件当中,常见的字段有(以root为例): root(用户名):x(加密口令):0(uid):0(gid):root(注释字段):/root(用户 ...