摘要: F Isomorphic Strings(Educational Codeforces Round 44 F) 难度:2300 赛时想到哈希,但是不知道怎么哈 一个长度为n的字符串,它所有字符的情况可以由26个长度为n的01串表示 而这个长度为n的01串可以被哈希化为一个整数,因此只需要26个整数就 阅读全文
posted @ 2025-07-14 21:33 arthalter 阅读(16) 评论(0) 推荐(0)
摘要: A P4838 P哥破解密码 f[i][j]表示前i个位置结尾有j个A的合法串数量,j为0,1,2 矩阵快速幂板子 #include<bits/stdc++.h> using namespace std; const int N = 1e7 + 10; const int mod = 1926081 阅读全文
posted @ 2025-07-13 19:34 arthalter 阅读(6) 评论(0) 推荐(0)
摘要: AHUACM第二场摸底测试复盘题解 A:Bottles(2016-2017 ACM-ICPC, NEERC, Southern Subregional Contest J) 难度:1900 这题只要注意到n=100对应的是\(O(n^4)\)的时空复杂度,就是比较水的dp了。(不过被2分钟就切的yb 阅读全文
posted @ 2025-07-12 23:51 arthalter 阅读(11) 评论(0) 推荐(0)
摘要: 莫比乌斯反演复健:Problem b(由于太颓废了也是6.30-7.6的周报) 先来一个莫比乌斯反演常见的模板 \[\begin{aligned} &\sum_i^n\sum_j^m[\gcd(i,j)=1]\\ \iff&\sum_i^n\sum_j^m\sum_{d|\gcd(i,j)}\mu( 阅读全文
posted @ 2025-07-08 22:13 arthalter 阅读(6) 评论(0) 推荐(0)
摘要: Codeforces Round 976 (Div. 2) 题解 2020B 一个常见的想法:开关灯=异或,虽然在这道题里没啥用 注意到,第i盏灯的按钮被按的次数就是i的除它本身以外的因子个数 而完全平方数的因子数为奇数,其他数的因子数为偶数 点击查看更多信息 #include<bits/stdc+ 阅读全文
posted @ 2024-10-03 10:29 arthalter 阅读(73) 评论(0) 推荐(0)