tetrahedron Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 889    Accepted Submission(s): 382 Problem Description Given four points ABCD, if ABCD is a tetrahedron, calculate the inscribed spher…
tetrahedron 传送门 Time Limit: 2000/1000 MS (Java/Others)   Memory Limit: 65536/65536 K (Java/Others) Problem DescriptionGiven four points ABCD, if ABCD is a tetrahedron, calculate the inscribed sphere of ABCD. InputMultiple test cases .Each test cases…
题目链接 tetrahedron 题目大意 输入一个四面体求其内心,若不存在内心则输出"O O O O" 解题思路 其实这道题思路很简单,只要类推一下三角形内心公式就可以了. 至于如何判断无解,计算一下体积若V<=0则无解 Code #include <bits/stdc++.h> using namespace std; const double eps = 1e-8; struct point{ double x, y, z; point (double xx =…
输入4个点三维坐标,如果是六面体,则输出内切球的球心坐标和半径. 点pi对面的面积为si,点a,b,c组成的面积=|ab叉乘ac|/2. 内心为a,公式: s0=s1+s2+s3+s4 a.x=∑si*pi.x/s0 a.y=∑si*pi.y/s0 a.z=∑si*pi.z/s0 n为p1.p2.p3的法向量,n=p1p2叉乘p1p3 半径=p1a点乘n/|n| #include <cstdio> #include <cmath> #define dd double struct…
tetrahedron/center> 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5726 Description Given four points ABCD, if ABCD is a tetrahedron, calculate the inscribed sphere of ABCD. Input Multiple test cases (test cases ≤100). Each test cases contains a lin…
斐波那契数列后四位可以用快速幂取模(模10000)算出.前四位要用公式推 HDU 3117 Fibonacci Numbers(矩阵快速幂+公式) f(n)=(((1+√5)/2)^n+((1-√5)/2)^n)/√5 假设F[n]可以表示成 t * 10^k(t是一个小数),那么对于F[n]取对数log10,答案就为log10 t + K,此时很明显log10 t<1,于是我们去除整数部分,就得到了log10 t 再用pow(10,log10 t)我们就还原回了t.将t×1000就得到了F[n…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1014 Uniform Generator Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 33120    Accepted Submission(s): 13137 Problem Description Computer simulati…
参考了: http://www.cnblogs.com/zhsl/archive/2013/08/10/3250755.html http://blog.csdn.net/chaobaimingtian/article/details/9852761 题意:一个有n个节点的树,每个节点存有一份独一无二的信息,要求用最小的步数,把每个节点的信息共享给所有的节点.一个节点把自己所包含的所有信息传递给相邻的一个节点为一步. 题目不是求最小的步数,而是问最小的步数下,信息传递的方法有多少种. 分析: 最…
吉哥系列故事——礼尚往来 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1417    Accepted Submission(s): 733 Problem Description 吉哥还是那个吉哥 那个江湖人称“叽叽哥”的基哥 每当节日来临,女友众多的叽叽哥总是能从全国各地的女友那里收到各种礼物. 有礼物收到当然值得高兴,但回礼确是…
Find a path Frog fell into a maze. This maze is a rectangle containing NN rows and MM columns. Each grid in this maze contains a number, which is called the magic value. Frog now stays at grid (1, 1), and he wants to go to grid (N, M). For each step,…