博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
BNUOJ34977夜空中最亮的星(数学,向量的应用)
阅读量:7037 次
发布时间:2019-06-28

本文共 2735 字,大约阅读时间需要 9 分钟。

夜空中最亮的星

Time Limit: 2000ms
Memory Limit: 65536KB
64-bit integer IO format: 
%lld      Java class name: 
Main
         
Font Size: 
+  
-
Type:   None Graph Theory      2-SAT     Articulation/Bridge/Biconnected Component      Cycles/Topological Sorting/Strongly Connected Component      Shortest Path          Bellman Ford         Dijkstra/Floyd Warshall      Euler Trail/Circuit      Heavy-Light Decomposition      Minimum Spanning Tree      Stable Marriage Problem      Trees      Directed Minimum Spanning Tree      Flow/Matching         Graph Matching              Bipartite Matching              Hopcroft–Karp Bipartite Matching              Weighted Bipartite Matching/Hungarian Algorithm          Flow              Max Flow/Min Cut              Min Cost Max Flow  DFS-like     Backtracking with Pruning/Branch and Bound      Basic Recursion      IDA* Search     Parsing/Grammar      Breadth First Search/Depth First Search      Advanced Search Techniques          Binary Search/Bisection          Ternary Search  Geometry      Basic Geometry     Computational Geometry      Convex Hull      Pick's Theorem Game Theory      Green Hackenbush/Colon Principle/Fusion Principle      Nim      Sprague-Grundy Number  Matrix     Gaussian Elimination      Matrix Exponentiation  Data Structures      Basic Data Structures      Binary Indexed Tree      Binary Search Tree      Hashing     Orthogonal Range Search      Range Minimum Query/Lowest Common Ancestor      Segment Tree/Interval Tree      Trie Tree      Sorting     Disjoint Set  String      Aho Corasick     Knuth-Morris-Pratt      Suffix Array/Suffix Tree  Math      Basic Math     Big Integer Arithmetic      Number Theory          Chinese Remainder Theorem          Extended Euclid          Inclusion/Exclusion          Modular Arithmetic      Combinatorics         Group Theory/Burnside's lemma          Counting      Probability/Expected Value  Others     Tricky      Hardest     Unusual      Brute Force      Implementation     Constructive Algorithms      Two Pointer      Bitmask     Beginner      Discrete Logarithm/Shank's Baby-step Giant-step Algorithm      Greedy      Divide and Conquer  Dynamic Programming                 
   
Tag it!

想要在陌生的地方不迷路。分清楚方向是非常重要的。看星星就是一个非常好的辅助方法。

在一段时间内每晚的同一时间,天上星星的排布是差点儿不变的

每颗星星的亮暗程度都有一个标识。称为星等。用一个实数来表示。

这个实数的值越小,代表星星越亮,在灯光明亮的城市中能看到的星星的星等范围为 - \infty ~ 3.5等左右。

Map同学害怕丢掉Map这个称号,每晚都勤劳地记下当天帝都星星的排布情况。他面向正北方向站立,将看到的天空映射到一张巨大的直角坐标系上,那么每颗星星都拥有了一个坐标。

这天Map同学来到了漂亮的哈尔滨,抬头看见了最亮的星星木星和第二亮的北河三。他朝向他以为的北方站立。像在帝都一样地计算出它们的坐标。

但实际上他并非总能凭直觉找到北的。并且对于使用的坐标系的刻度的大小也没有办法把握。

那么如今他想知道。最少须要转多少角度,他才可以面向正北

Input

第一行为数据组数t(t<=1000)。

接下来,对每组数据:

第一行为n(2<=n<=1000)。表示前一天在帝都看到的星星的数量。

下面为n行,每行3个实数,分别为n颗星星的坐标和星等。

最后一行为4个实数,分别为木星和北河三的坐标。

以上实数绝对值不超过1000。π取3.14159265358。

Output

输出一行,为所须要转的最小角度。保留3位小数。

Sample Input

120 0 -21 0 00 0 0 1.2

Sample Output

90.000

Source

         
#include
#include
#define PI 3.14159265358typedef struct nnn{ double x,y,d;}node;int main(){ int t,n; double s,jd,x,y,dis[2]; node star[2],st[2],xl[2]; scanf("%d",&t); while(t--) { scanf("%d",&n); jd=10000; star[0].d=star[1].d=10000; for(int i=0;i
180)jd=360-jd; printf("%.3lf\n",jd); }}

转载地址:http://ofnal.baihongyu.com/

你可能感兴趣的文章
zabbix安装
查看>>
IT兄弟连 JavaWeb教程 EL表达式中的内置对象
查看>>
关于数据库设计的思考
查看>>
ubuntu安装svn
查看>>
logstash 介绍
查看>>
OSChina 周三乱弹 —— 我在 if 里,你却在 else
查看>>
OSChina 周五乱弹 —— 但愿老死电脑间,不愿鞠躬老板前
查看>>
OSChina 周四乱弹 ——小小编辑教你装逼斗气
查看>>
CRS-4402(Doc ID 1212703.1) 续
查看>>
Maven项目中添加jFinal包以及源文件
查看>>
Android实用笔记——使用ViewPager实现导航
查看>>
Orcale无奈的Char与Varchar
查看>>
深入理解Java虚拟机 读书笔记 之 how to STW
查看>>
有关数据库事务的一些理解
查看>>
clang: error: exit code 1 错误详解
查看>>
MyEclipse Web Project转Eclipse Dynamic Web Project
查看>>
ELK之权限管理
查看>>
×_7_12_2013 I: Light on or off
查看>>
mac下idea性能优化
查看>>
eclipse格式化代码不自动换行方法
查看>>