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. 多线程程序设计学习(5)balking模式和timed模式

    Balking[返回模式]timed[超时模式]一:balking pattern的参与者--->GuardedObject(被警戒的对象) --->该模式的角色:模拟修改警戒对象的线程, ...

  2. 如何使用 orachk 工具

    Oracle RAC 安装完毕后的健壮性是一个令人头疼的问题.之前Oracle为之专门推出了raccheck工具,确实方便了我们这些个苦逼的DBA.现在Oracle在raccheck的基础之上又推出了 ...

  3. ruby函数回调的实现方法

    以前一直困惑ruby不像python,c可以将函数随意传递,然后在需要的时候才去执行.其实本质原因是ruby的函数不是对象. 通过查阅资料发现可以使用如下方法: def func(a, b) puts ...

  4. 字符集编码Unicode ,gb2312 cp936

    这是一篇程序员写给程序员的趣味读物.所谓趣味是指可以比较轻松地了解一些原来不清楚的概念,增进知识,类似于打RPG游戏的升级.整理这篇文章的动机是两个问题: 问题一:使用Windows记事本的“另存为” ...

  5. HDU 5437 Alisha’s Party

    题意:有k个人带着价值vi的礼物来,开m次门,每次在有t个人来的时候开门放进来p个人,所有人都来了之后再开一次门把剩下的人都放进来,每次带礼物价值高的人先进,价值相同先来先进,q次询问,询问第n个进来 ...

  6. WebView介绍

    本文主要对WebView进行介绍,包括webView 4个可以定制的点.设置WebView back键响应.控制网页的链接仍在webView中跳转.显示页面加载进度.处理https请求.利用addJa ...

  7. ASP.NET 日期 时间 年 月 日 时 分 秒 格式及转换

    在平时编码中,经常要把日期转换成各种各样的形式输出或保持,今天专门做了个测试,发现DateTime的ToString()方法居然有这么多的表现形式,和大家一起分享. DateTime time=Dat ...

  8. qt文本编辑器

    示例代码: mainwindow.cpp #include "mainwindow.h" #include "ui_mainwindow.h" #include ...

  9. Apache Rewrite常用设置说明

    例子: RewriteEngine on 打开引擎 RewriteRule test.html /test.php [L] RewriteRule test.html?$ /tianqi.php?s1 ...

  10. Selection sort

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...