hdu 5726 tetrahedron 立体几何】的更多相关文章

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…
GCD Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2742    Accepted Submission(s): 980 Problem Description Give you a sequence of N(N≤100,000) integers : a1,...,an(0<ai≤1000,000,000). There ar…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5726 给你n个数,q个询问,每个询问问你有多少对l r的gcd(a[l] , ... , a[r]) 等于的gcd(a[l'] ,..., a[r']). 先用RMQ预处理gcd,dp[i][j] 表示从i开始2^j个数的gcd. 然后用map存取某个gcd所对应的l r的数量. 我们可以在询问前进行预处理,先枚举i,以i为左端点的gcd(a[i],..., a[r])的种类数不会超过log2(n)…
[题目链接] http://acm.hdu.edu.cn/showproblem.php?pid=5726 [题目大意] 给出数列An,对于询问的区间[L,R],求出区间内数的GCD值,并且求出GCD值与其相等的区间总数 [题解] 首先,固定一个区间的右端点,利用GCD的递减性质,可以求出GCD相等的区间左端点的范围,将其范围的左右端点保存下来,同时,对于每个新产生的区间,以其GCD值为下标的MAP值+1,最后对于每个询问,在其右端点保存的范围中查找,获得其GCD值,同时在MAP中获取该GCD值…
http://acm.split.hdu.edu.cn/showproblem.php?pid=5726 题意:给出一串数字,现在有多次询问,每次询问输出(l,r)范围内所有数的gcd值,并且输出有多少数量区间的gcd值等于该gcd值. 思路: 第一问的话可以用线段树或RMQ来解决,RMQ的话简单点. 有意思的是第二问,假设我们现在固定左端点,那么往右端扩大区间时,gcd单调不增,并且每次至少减少一倍,所以我们可以二分枚举. #include<iostream> #include<alg…
GCD/center> 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5726 Description Give you a sequence of N(N≤100,000) integers : a1,...,an(0<ai≤1000,000,000). There are Q(Q≤100,000) queries. For each query l,r you have to calculate gcd(al,,al+1,...,ar) a…
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 =…
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…
传送门 GCD Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem DescriptionGive you a sequence of $N(N≤100,000)$ integers : $a_1,\cdots,a_n(0<a_i≤1000,000,000)$. There are $Q(Q≤100,000)$ queries. For each query $l…