上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 56 下一页
摘要: CodeForces - 981D 从高位到低位去枚举,如果存在一种分配>=(ans|i),ans|=i;检验的时候用区间dp,f[i][j]表示前i个分成j段能不能成功,当然每一段都>=(ans|i) #include <iostream> #include <cstdio> #include < 阅读全文
posted @ 2020-02-22 20:17 WeiAR 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 00001111在前i-1个全相等的情况下,对于位置i,如果a[i]!=a[i-1],要么把前i-1个反转,要么把n-(i-1)位置的反转。按位处理,每次从这两个情况里面取最大值。最后从这些最大值里取最小值就是答案 #include <iostream> #include <cstdio> #inc 阅读全文
posted @ 2020-02-11 17:49 WeiAR 阅读(354) 评论(0) 推荐(0) 编辑
摘要: CodeForces - 1201B 首先和是偶数,最大的数要小于总和的一半 #include <iostream> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <cstring> 阅读全文
posted @ 2020-02-10 19:25 WeiAR 阅读(137) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <cstring> #define inf 2147483647 #define N 41000 阅读全文
posted @ 2019-11-07 13:57 WeiAR 阅读(183) 评论(0) 推荐(0) 编辑
摘要: python3 -m pip install PyQt5 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com 阅读全文
posted @ 2019-11-04 20:35 WeiAR 阅读(172) 评论(0) 推荐(0) 编辑
摘要: poj2777区间修改,区间查询mark=-1表示这个区间有多种颜色,否则就1种 阅读全文
posted @ 2019-09-20 23:10 WeiAR 阅读(175) 评论(0) 推荐(0) 编辑
摘要: P1487 失落的成绩单a[i]=a[i-2]-2.0*a[i-1]+2.0*d;a[2]越大,a[3]越小a[3]越大,a[4]越小所以a[2]越大,a[4]越大,a[3]越小就有了单调性,分奇偶进行二分细节:二分的时候,l不一定为0,1e10为浮点数,eps小点好 阅读全文
posted @ 2019-09-04 17:18 WeiAR 阅读(168) 评论(0) 推荐(0) 编辑
摘要: P2290 [HNOI2004]树的计数prufer序列模板题 阅读全文
posted @ 2019-08-26 17:03 WeiAR 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-08-26 16:57 WeiAR 阅读(194) 评论(0) 推荐(0) 编辑
摘要: P1404 平均数二分答案,问题在于怎么O(n)check,把每个数都-mid,然后求前缀和,有点像最大子段和,精度问题的话就都乘1000 阅读全文
posted @ 2019-08-26 16:03 WeiAR 阅读(183) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 56 下一页