Relatively Prime Powers CodeForces - 1036F Consider some positive integer xx. Its prime factorization will be of form x=2k1⋅3k2⋅5k3⋅-x=2k1⋅3k2⋅5k3⋅- Let's call xx elegant if the greatest common divisor of the sequence k1,k2,-k1,k2,- is equal to 11. F…
暴力搞肯定不行,因此我们从小到大枚举素数,用n去试除,每次除尽,如果已经超过20,肯定是no.如果当前枚举到的素数的(20-已经找到的质因子个数)次方>剩下的n,肯定也是no.再加一个关键的优化,如果剩下的次数是1了,就直接判定剩下的n是否是素数.这样可以保证次方>=2,将我们需要枚举的素数限制在200w以内,就可做了.线性筛在这题虽然不必要,但是可以当个板子存下来. The hacker Michael develops breakthrough password manager, whic…
The hacker Michael develops breakthrough password manager, which is called KEK (Keeper of Encrypted Keys). A distinctive feature of KEK is excellent security. To achieve this, Michael had to develop innovative encryption scheme. For example, in the w…