上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 66 下一页
摘要: 传送门 解题思路 trie树模板 阅读全文
posted @ 2018-10-07 21:01 Monster_Qi 阅读(90) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2018-10-06 19:28 Monster_Qi 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 传送门 ## T1区间修改+单点查询。差分树状数组。 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int MAXN = 10000005; inline int rd(){ int 阅读全文
posted @ 2018-10-05 19:31 Monster_Qi 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 传送门 ## $T1$一道结论题,设原来A队能力最大的是x,那么A队的选择方案就是$2^{x-1}$,B队的选择方案就是$(2^{n-x}-1)$种,因为不能不选。其中$1\leq x\leq n$,那么根据乘法原理,最后的答案就是 $\sum\limits^{n-1}_{x=1}2^{x-1}*( 阅读全文
posted @ 2018-10-05 19:07 Monster_Qi 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 传送门 解题思路 扩展 $crt​$,就是中国剩余定理在模数不互质的情况下,首先对于方程​ $\begin{cases} x\equiv a_1\mod m_1\\x\equiv a_2\mod m_2\end{cases}$来说,可以将其写为: $\begin{cases} x=k_1*m_1+a 阅读全文
posted @ 2018-10-04 19:27 Monster_Qi 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 突然意识到以前写的都是假的dij,感谢GhostCai神犇。 #include<iostream> #include<cstdio> #include<cstring> #include<queue> #define int long long using namespace std; const 阅读全文
posted @ 2018-10-02 17:19 Monster_Qi 阅读(1251) 评论(0) 推荐(0) 编辑
摘要: 传送门 解题思路 毒瘤题,,刚开始写了个奇奇怪怪的哈希,结果T了5个点。。后来深(kan)入(le)思(ti)考(jie),发现c的范围很小,设$f[a][b][c][d][e][pre]​$表示还能涂一个格子的有a个,两个格子的有b个。。。pre表示上一个涂的颜色,转移看代码,比较好想。 #inc 阅读全文
posted @ 2018-10-02 15:59 Monster_Qi 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 传送门 解题思路 树状数组优化dp,f[i]表示前i个奶牛的分组的个数,那么很容易得出$f[i]=\sum\limits_{1\leq j\leq i}f[j-1]*(sum[i]\ge sum[j-1])$,但是这样的时间复杂度是$O(n^2)​$,所以考虑优化,发现必须满足$sum[i]\ge 阅读全文
posted @ 2018-10-02 14:32 Monster_Qi 阅读(216) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/blog/IowaBattleship/latex-gong-shi-tai-quan 阅读全文
posted @ 2018-10-01 14:11 Monster_Qi 阅读(1837) 评论(0) 推荐(0) 编辑
摘要: 传送门 解题思路 快被调死的码农题,,,其实就是一个边权下放到点权的线段树+树剖。 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cstdlib> using namespace 阅读全文
posted @ 2018-10-01 14:10 Monster_Qi 阅读(151) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 66 下一页