
数论
ZHXU1998
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #596 D. Power Products
D. Power Products https://codeforces.com/contest/1247/problem/D 题意 找 ai∗aj=xka_i * a_j = x^kai∗aj=xk 的数量 既然是 xkx^kxk 那么 对于能乘出他们的数来说 质因子的质数必然是 k 的倍数 然后就可以考虑O(n)O(n)O(n) 求了 用STL存 每个数质因子 和 它的个数 如果mod k...原创 2019-10-28 17:53:18 · 413 阅读 · 3 评论 -
Codeforces Round #586 (Div. 1 + Div. 2) D. Alex and Julia (数论|二部图性质)
D. Alex and Julian https://codeforces.com/contest/1220/problem/D 二分图性质 无奇环 而且 我们取尝试一些数据 发现 最后省的奇数最多才是最好的 1 3 5 7 9 2 6 10 14 18 其中 1 2 是不可能同时出现 所以 这题慢慢看出规律了 找最多的奇数层(2次幂一样多) 剩下不同层的删了 #include <bits/...原创 2019-09-22 09:45:04 · 144 阅读 · 0 评论 -
Codeforces 1114C (n阶乘在b进制下的末尾0数)
分解bbb的质因数∏i=1mpici{\prod_{i=1}^m{p_i^{c_i}}}∏i=1mpici 计算答案并除以cic_ici,再取min 所以100!末尾有多少个零为:100/5+100/25=20+4=24 那么1000! 同理得: 1000/5+1000/25+1000/125=200+40+8=248 https://codeforces.com/contest/1114...原创 2019-10-01 08:30:30 · 260 阅读 · 0 评论