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. delphi中计算指定日期是该月第几周的函数

      NthDayOfWeek 计算并返回指定日期是该月第几周 Unit:DateUtils function NthDayOfWeek(const AValue: TDateTime): Word; ...

  2. MySQL数据库分布式事务XA优缺点与改进方案

    1 MySQL 外部XA分析 1.1 作用分析 MySQL数据库外部XA可以用在分布式数据库代理层,实现对MySQL数据库的分布式事务支持,例如开源的代理工具:ameoba[4],网易的DDB,淘宝的 ...

  3. asp调用.net xml web services

    来源:http://www.cnblogs.com/notus/archive/2006/08/10/473000.html#2662503 (是不是实际上可以用这个办法调用任何xml web ser ...

  4. getView 数据最后加一项

    if (position != count-1) {      viewHolder.imgLineEnd.setVisibility(View.GONE); } else {       viewH ...

  5. Bigger is Better

    题意: 有n个火柴棒,已知拼成9个数字花费的数目,求能拼出的能整除m的最大数 分析: dp[i][j]表示,用i个火柴棒,拼出的数余m余数为j时的最大数 int tmp=dp[i][j]*10+k;( ...

  6. [原创]Android应用 - YE启动器APP(YeLauncherApp)

      支持解冻.冻结APP 支持在本APP列表隐藏指定APP 支持检测系统核心APP,防止误点冻结导致手机变砖 支持清理APP缓存 支持强制停止APP Apk文件仅仅47KB 自用.开源 类似APP:A ...

  7. c#基类 常用数据验证的封装,数字,字符,邮箱的验证

    #region 常用数据验证的封装,数字字符的验证       /// <summary>       /// 常用数据验证的封装,数字字符的验证       /// </summa ...

  8. mybatis系列-04-mybatis开发dao的方法

    4.1     SqlSession使用范围 4.1.1     SqlSessionFactoryBuilder 通过SqlSessionFactoryBuilder创建会话工厂SqlSession ...

  9. Spark系列(七)Master中的资源调度

    资源调度 说明: Application的调度算法有两种,分别为spreadOutApps和非spreadOutApps spreadOutApps 在spark-submit脚本中,可以指定要多少个 ...

  10. TopCoder SRM 605 DIV1

    604的题解还没有写出来呢.先上605的. 代码去practice房间找. 说思路. A: 贪心,对于每个类型的正值求和,如果没有正值就取最大值,按着求出的值排序,枚举选多少个类型. B: 很明显是d ...