Apparent Magnitude

Time Limit: 20 Sec

Memory Limit: 256 MB

题目连接

http://acm.uestc.edu.cn/#/problem/show/481

Description

*The scale now used to indicate magnitude originates in the Hellenistic practice of dividing stars visible to the naked eye into six magnitudes. The brightest stars were said to be of first magnitude (), while the faintest were of sixth magnitude (), the limit of human visual perception (without the aid of a telescope). Each grade of magnitude was considered twice the brightness of the following grade (a logarithmic scale). This somewhat crude method of indicating the brightness of stars was popularized by Ptolemy in his Almagest, and is generally believed to originate with Hipparchus. This original system did not measure the magnitude of the Sun. *

*In 1856, Norman Robert Pogson formalized the system by defining a typical first magnitude star as a star that is times as bright as a typical sixth magnitude star; thus, a first magnitude star is about times as bright as a second magnitude star. The fifth root of is known as Pogson's Ratio. *

-- from Wikipedia

The apparent visual magnitude and its corresponding relative brightness are listed below (the accurate ratio is , and we use a rounded value here for simplicity ). Your task is to decide the apparent visual magnitude according to a given relative brightness.

Apperant magnitude Brightness relative to Vega

Input

The first line of the input is (no more than ), which stands for the number of test cases you need to solve.
Every case contains one line with a single real number standing for the star's brightness relative to Vega.

Output

For every test case, you should output Case #k: first, where  indicates the case number and counts from , then output the grade of apparent magnitude. If the star is equally bright or brighter than Vega you should output Too Bright. If the star is less bright than a sixth magnitude star you should output Invisible. (The test data is specially designed so that you can simply ignore the precision problem of the float number)

Sample Input

5
1.0001
0.8
0.17
0.015
0.001

Sample Output

Case #1: Too Bright
Case #2: 1
Case #3: 2
Case #4: 5
Case #5: Invisible

HINT

题意

给你一些数字的范围,让你输出是什么类型

题解:

直接输出就好了,判断范围就好了

代码

#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define test freopen("test.txt","r",stdin)
const int maxn=;
#define mod 1000000007
#define eps 1e-9
const int inf=0x3f3f3f3f;
const ll infll = 0x3f3f3f3f3f3f3f3fLL;
inline ll read()
{
ll x=,f=;char ch=getchar();
while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
return x*f;
}
//************************************************************************************* int main()
{
//この戦い终わった、故郷に帰って结婚するだん!!! ??\
cout<<"please hack me"<<endl;
int t=read();
for(int cas=;cas<=t;cas++)
{ double a;
cin>>a;
printf("Case #%d: ",cas);
if(a<0.004)
cout<<"Invisible"<<endl;
else if(a<0.01)
cout<<""<<endl;
else if(a<0.025)
cout<<""<<endl;
else if(a<0.063)
cout<<""<<endl;
else if(a<0.16)
cout<<""<<endl;
else if(a<0.4)
cout<<""<<endl;
else if(a<)
cout<<""<<endl;
else
cout<<"Too Bright"<<endl; }
}

CDOJ 481 Apparent Magnitude 水题的更多相关文章

  1. cdoj 65 CD Making 水题

    CD Making Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/show/65 De ...

  2. cdoj 26 遮挡判断(shadow) 水题

    遮挡判断(shadow) Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/show/26 ...

  3. cdoj 24 8球胜负(eight) 水题

    8球胜负(eight) Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/show/24 ...

  4. hdu 1051:Wooden Sticks(水题,贪心)

    Wooden Sticks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tot ...

  5. HDOJ 2317. Nasty Hacks 模拟水题

    Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tota ...

  6. ACM :漫漫上学路 -DP -水题

    CSU 1772 漫漫上学路 Time Limit: 1000MS   Memory Limit: 131072KB   64bit IO Format: %lld & %llu Submit ...

  7. ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)

    1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 154  Solved: 112[ ...

  8. [poj2247] Humble Numbers (DP水题)

    DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ...

  9. gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,

    1195: 相信我这是水题 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 821  Solved: 219 Description GDUT中有个风云人 ...

随机推荐

  1. android学习笔记六

    Android中Activity的Intent大全 Api Level 3: (SDK 1.5) android.intent.action.ALL_APPS android.intent.actio ...

  2. [转载] python+Eclipse+pydev环境搭建

    转自:http://www.cnblogs.com/Bonker/p/3584707.html 编辑器:Python 自带的 IDLE 简单快捷, 学习Python或者编写小型软件的时候.非常有用. ...

  3. TOAD FOR MYSQL 进行数据插入时乱码的解决办法---MariaDB 5.5

    最近使用mysql是发现插入的数据乱码,几经周折终于找到的解决方法,特作备忘. 开始有将mysql的字符集全部设置成utf8,如下: SHOW VARIABLES LIKE 'character_se ...

  4. STL六大组件之——仿函数偷窥

    仿函数(functor),就是使一个类或类模板的使用看上去象一个函数.其实现就是类或类模板中对operator()进行重载,这个类或类模板就有了类似函数的行为.仿函数是智能型函数就好比智能指针的行为像 ...

  5. Leetcode Largest Number c++ solution

    Total Accepted: 16020 Total Submissions: 103330     Given a list of non negative integers, arrange t ...

  6. 主席树模板(poj2104)

    主席树是可持久化线段树,可以记录线段树的历史版本. 代码中和线段树不同的是,l,r记录的是左右子树编号,因为普通的线段树版本中,左右子树自然就是o<<1和o<<1|1,但是主席 ...

  7. XML学习笔记(1)--XML概述

    XML基本概念 XML—extensible Markup Language(可扩展标记语言) XML最基本的三个概念 1)XML语言---描述事物本身(可扩展) 2)XSL语言---展现事物表现形式 ...

  8. Spring入门(2)-通过构造器注入Bean

    Spring入门(2)-通过构造器注入Bean 前一篇文章将了最基本的spring例子,这篇文章中,介绍一下带有参数的构造函数和通过构造器注入对象引用. 0. 目录 带有参数的构造函数 通过构造器注入 ...

  9. javascript中对象的每个实例都具有的属性和方法

  10. ASP.NET MVC 前端(View)向后端(Controller)中传值

    在MVC中,要把前端View中的值传递给后端Controller, 主要有两种方法 1. 利用Request.Form 或者 Request.QueryString public ActionResu ...