上一页 1 2 3 4 5 6 7 ··· 36 下一页
摘要: 先推公式,推出个 "这" ,然后因为是 $0/1$ 矩阵,选一个有损耗,两个一组有加成,就想到了最大权闭合子图,(飞行计划问题) cpp include include include include using namespace std; int n, uu, ss, tt, hea[25050 阅读全文
posted @ 2018-05-25 11:43 poorpool 阅读(187) 评论(0) 推荐(0)
摘要: 先考虑一下一个集合怎么用 $O(n)$ 时间求出来,然后用主席树推广到一个序列就可以了。大致思想就是考虑一个数的权值和它前面的数的和的关系。 阅读全文
posted @ 2018-05-25 09:57 poorpool 阅读(188) 评论(0) 推荐(0)
摘要: "ref" 真是道组合数学神题啊……第一次见第一类斯特林数…… 阅读全文
posted @ 2018-05-25 08:43 poorpool 阅读(240) 评论(0) 推荐(0)
摘要: "ref" 不是太懂…… 阅读全文
posted @ 2018-05-24 19:45 poorpool 阅读(258) 评论(0) 推荐(0)
摘要: 我发现我的构造方法好像不太一样而且比较显然?……先读入 $q$ 数组(下表从零开始)。 记 $i j$ 时,$a_{i j}=1/i^2$;$i = j$ 时,$a_{i j}=0$。 答案 $E_i=\sum_{j=0}^{n 1}a_{i j}q_j$,可以用 FFT 优化,于是就做完了……吗? 阅读全文
posted @ 2018-05-23 22:07 poorpool 阅读(105) 评论(0) 推荐(0)
摘要: "ref" 总的来说,就是 1. 容斥转化为点对应到点集问题。 2. 树形 dp 解决转化后的问题。 cpp include include include include using namespace std; typedef long long ll; int n, m, hea[19], c 阅读全文
posted @ 2018-05-23 20:03 poorpool 阅读(128) 评论(0) 推荐(0)
摘要: "ref" cpp include include include include include using namespace std; typedef pair par; int n; par a[100005]; set se; map mp; int main(){ cin n; for( 阅读全文
posted @ 2018-05-23 18:56 poorpool 阅读(1145) 评论(0) 推荐(0)
摘要: 还是挺好做的,$(e_1,e_2)=1 \Rightarrow e_1s+e_2t=0$,$m \equiv m^1 \equiv m^{e_1s+e_2t} \equiv c_1^s c_2^t$。exgcd求逆元 阅读全文
posted @ 2018-05-23 11:04 poorpool 阅读(284) 评论(0) 推荐(0)
摘要: 大概就是一个形状要嵌到矩阵里头这样子,看看代码就明白了qwq cpp include include include include include using namespace std; int n, m, k, lim=1, limcnt, rev[8388655]; char ss[5000 阅读全文
posted @ 2018-05-23 09:16 poorpool 阅读(462) 评论(0) 推荐(0)
摘要: 还是很好做的,大致就是manacher,每个位置为中心的最长回文串要是能抵到最右边就合法,要是能抵到最左边,那这个点的是否合法取决于以这个点为中心的最长回文串的右端点是否合法。 阅读全文
posted @ 2018-05-22 21:09 poorpool 阅读(454) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 36 下一页