POJ-2661Factstone Benchmark】的更多相关文章

链接:传送门 题意:一个人自命不凡,他从1960年开始每10年更新一次计算机的最长储存长数.1960年为4位,每10年翻一倍.给出一个年份y,问这一年计算机可以执行的n!而不溢出的最大n值 思路:如果直接比较 2^x - 1 < n! 是一定会溢出的,所以不妨对左右取对数,使之变为 x*log10(2) < log10(n!) . 使用斯特林公式优化一下n!的计算就能解决这个问题了. /******************************************************…
//题意是对于给定的x,求满足n! <= 2^(2^x)的最大的n//两边同取以二为底的对数,可得: lg2(n!) <= 2^x 1.   log2(n!) = log2(1) + log2(2) + .. + log2(n);一个循环即可 2.   Stirling #include <iostream> #include <string> #include<sstream> #include <cmath> #include <map…
/** 大意: 求m!用2进制表示有多少位 m! = 2^n 两边同时取对数 log2(m!) = n 即 log2(1) + log2(2)+log2(3)+log2(4)...+log2(m) = n 枚举即可 拓展: 可以用斯特林(Stirling)公式求解 斯特林(Stirling)公式: log(x) =====ln(x) **/ #include <iostream> #include <cmath> using namespace std; int main() {…
链接:http://poj.org/problem?id=1502 MPI Maelstrom Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5249   Accepted: 3237 Description BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed share…
MPI Maelstrom Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 4017   Accepted: 2412 Description BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchic…
题目链接:http://poj.org/problem?id=1502 Description BIT has recently taken delivery of their processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee's research advisor, Jack Swigert, has ask…
POJ 1502 MPI Maelstrom / UVA 432 MPI Maelstrom / SCU 1068 MPI Maelstrom / UVALive 5398 MPI Maelstrom /ZOJ 1291 MPI Maelstrom (最短路径) Description BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shar…
Halloween treats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7644   Accepted: 2798   Special Judge Description Every year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets…
Find a multiple Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7192   Accepted: 3138   Special Judge Description The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000…
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286   Accepted: 8603   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a…