ICode9

精准搜索请尝试: 精确搜索
  • Codeforces1114C. Trailing Loves (or L'oeufs?)-(质因子分解)2021-04-01 19:01:47

    题目大意: 求n!转化为b进制后后导0的个数 思路: 我们首先考虑十进制转化为二进制者后,后导0的个数如何求 十进制数num y = num%2 num/=2 如果y为0则,该位为0,就是求num能连续除以几次2(在整除的条件下)   十进制是num,进制为b 我们可以采取同样的思路 但是! 这里n!太大了,没法直接算出来 我

  • 【Codeforces Round #538 (Div. 2) C. Trailing Loves (or L'oeufs?)】 分解质因数2019-03-02 10:03:51

    C. Trailing Loves (or L’oeufs?) 题意 求n!n!n!在b进制下末尾有多少个000 1≤10≤1018,2≤b≤10121 \leq 10 \leq 10^{18},2 \leq b \leq 10^{12}1≤10≤1018,2≤b≤1012 做法 这道题我们首先考虑101010进制,那就是看n!n!n!能够整除555多少次和整除222多少次。取个minminmin

  • CF#538(div 2) C. Trailing Loves (or L'oeufs?) 【经典数论 n!的素因子分解】2019-02-11 13:01:37

    任意门:http://codeforces.com/contest/1114/problem/C C. Trailing Loves (or L'oeufs?) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The number "zero" is called "love&qu

  • Codeforces Round #538 (Div. 2) CTrailing Loves (or L'oeufs?)2019-02-11 12:49:47

    这题明白的意思就是求n!在b进制下的后缀零的个数。 即最大的n!%(b^k)==0的k的值。我们需要将如果要构成b这个数,肯定是由一个个质因子相乘得到的。我们只需要求出b的质因子,然后分析n!中可以组成一个b的因子由多少个就可以了。 因为b是10的12次方,所以b的质因子某个因子大于了10的6次

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有