zoukankan      html  css  js  c++  java
  • LightOJ 1216 圆锥体积

    1001 - Opposite Task
    PDF (English) Statistics Forum
    Time Limit: 0.5 second(s) Memory Limit: 32 MB
    This problem gives you a flavor the concept of special judge. That means the judge is smart enough to verify your code even though it may print different results. In this problem you are asked to find the opposite task of the previous problem.

    To be specific, I have two computers where I stored my problems. Now I know the total number of problems is n. And there are no duplicate problems and there can be at most 10 problems in each computer. You have to find the number of problems in each of the computers.

    Since there can be multiple solutions. Any valid solution will do.

    Input
    Input starts with an integer T (≤ 25), denoting the number of test cases.

    Each case starts with a line containing an integer n (0 ≤ n ≤ 20) denoting the total number of problems.

    Output
    For each case, print the number of problems stored in each computer in a single line. A single space should separate the non-negative integers.

    Sample Input
    Output for Sample Input
    3
    10
    7
    7
    0 10
    0 7
    1 6


    PROBLEM SETTER: JANE ALAM JAN

     

    <span style="color:#6600cc;">/*************************************************
    
         author     :     Grant Yuan
         time       :     2014.8.7
         algorithm  :     计算几何
         source     :     Light Oj 1216
         
    **************************************************/
    
    #include<iostream>
    #include<cstdio>
    #include<cstring>
    #include<cstdlib>
    #include<algorithm>
    #include<cmath>
    #define pi acos(-1)
    
    using namespace std;
    int r1,r2,h,t,p;
    double h1,ans,r3;
    
    int main()
    {
        scanf("%d",&t);
        cout<<pi<<endl;
        for(int i=1;i<=t;i++)
        {
            scanf("%d%d%d%d",&r1,&r2,&h,&p);
            h1=(r2*h*1.0)/(r1-r2);
            r3=(p+h1)*r1*1.0/(h1+h);
            ans=(h1+p)*pi*r3*r3/3-h1*pi*r2*r2/3;
            printf("Case %d: %.7lf
    ",i,ans);
        }
        return 0;
    }
    </span>


     

  • 相关阅读:
    Windows 显示隐藏文件
    Python 程序一行代码解决乘法口诀表
    【转发】基于Bert-NER构建特定领域的中文信息抽取框架(上)
    【转发】GET和POST两种基本请求方法的区别
    【转发】实现yolo3模型训练自己的数据集总结
    第十章集合总结
    2016-2017 201671010134 异常处理
    JAVA基础编程
    2016-2017 201671010134 第六章总结
    java总结
  • 原文地址:https://www.cnblogs.com/codeyuan/p/4254456.html
Copyright © 2011-2022 走看看