摘要: 这题有点复杂,题目要求十进制数N!在B进制下表示后末尾的0个数和总的位数。分析如下:1. 求末尾0的个数:思路是将N!分解为素数的积,记录下<=B的素数因子的个数(小于等于B的原因代码中解释了)。然后不断地从N!的因子中提取因子,使之刚好能乘积为B,则这几个因子可使N!在B进制下末尾产生一个0,直... 阅读全文
posted @ 2014-04-25 20:51 acmicpcstar 阅读(197) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=5&page=show_problem&problem=286Pseudo-Random NumbersComputers normally c... 阅读全文
posted @ 2014-04-25 20:21 acmicpcstar 阅读(203) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=349Uniform GeneratorComputer simulations often require ... 阅读全文
posted @ 2014-04-24 22:08 acmicpcstar 阅读(283) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=509Just the FactsThe expressionN!, read as ``Nfactorial... 阅读全文
posted @ 2014-04-24 21:05 acmicpcstar 阅读(165) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=491Multiplying by RotationWarning: Not all numbers in t... 阅读全文
posted @ 2014-04-24 20:28 acmicpcstar 阅读(130) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1051Light, more lightThe ProblemThere is man named "mab... 阅读全文
posted @ 2014-04-24 19:42 acmicpcstar 阅读(191) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=516Skew BinaryWhen a number is expressed in decimal, th... 阅读全文
posted @ 2014-04-24 19:03 acmicpcstar 阅读(395) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1053Problem B: Myacm TrianglesSource file:triangle.{c,c... 阅读全文
posted @ 2014-04-24 18:30 acmicpcstar 阅读(196) 评论(0) 推荐(0) 编辑
摘要: va.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1328Problem A: BilliardIn a billiard table with horizontal side... 阅读全文
posted @ 2014-04-24 15:47 acmicpcstar 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { 8 cout ::max)();11 cout ::min)() ::max)();14 cout ::min)() :... 阅读全文
posted @ 2014-04-24 15:06 acmicpcstar 阅读(323) 评论(0) 推荐(0) 编辑