摘要: 字典树模板题。 Code 先贴上字典树板子的代码。 #include<bits/stdc++.h> using namespace std; int t,n,q,tree[3000010][71],cnt[3000010],c; char s[3000010]; int num(char x){ i 阅读全文
posted @ 2024-05-16 23:01 Weslie_qwq 阅读(13) 评论(0) 推荐(0)
摘要: Idea 首先要跑出每一个数的位数。 接下来,我们枚举两个数中后面的数。但是我们不需要枚举前面的数。 考虑对于 aka_kak​,aka_kak​ 位数为 cnticnt_icnti​ 时 iii 的贡献: a1×cntk+ak+a2×cntk+ak+⋯+ak−1×cntk+ak+ak+1×cntk 阅读全文
posted @ 2024-05-16 22:45 Weslie_qwq 阅读(11) 评论(0) 推荐(0)
摘要: Idea 因为 ai<108a_i<10^8ai​<108,所以 0<ai+aj<2×1080<a_i+a_j<2\times 10^80<ai​+aj​<2×108。 考虑对于 ai+aj<108a_i+a_j<10^8ai​+aj​<108 和 ai+aj≥108a_i+a_j\ge 10^8a 阅读全文
posted @ 2024-05-16 22:35 Weslie_qwq 阅读(20) 评论(0) 推荐(0)