摘要:
题意 给定数组$a(\left| a \right|\leq 10^5)$和整数$k(2\leq k \leq 100)$,问满足一下条件的二元组$$的数目: $1 \leq i using namespace std; typedef long long ll; const int maxn=1e 阅读全文
摘要:
题意 给定整数c和数组a,b,$a_i$表示通过爬楼梯的方法从第$i$层到$i+1$层需要的时间,$b_i$表示通过坐电梯的方法从第$i$层到$i+1$层需要的时间,坐电梯前需要等c单位时间。即对于$i using namespace std; typedef long long ll; const 阅读全文
摘要:
Google Kick Start Round G 2019 Book Reading 暴力,没啥好说的 cpp include using namespace std; typedef long long ll; const int maxn=1e5+5; int n,m,q,p[maxn],r[ 阅读全文
摘要:
解题思路: fail树上用权值线段树合并求right/endpos集合,再用倍增找到待查询串对应节点,然后权值线段树求第k大。 cpp include using namespace std; typedef long long ll; const int maxn=1e5+5; int n,q; 阅读全文
摘要:
题意 给定一个长度为n字符串,字符集大小为m(1 using namespace std; typedef long long ll; const int maxn=1e6+5; const int mod=1e9+7; struct Suffix_Automaton{ struct state{ 阅读全文