摘要: 单调队列 cpp include include using namespace std; int n, l, r, dp[400005], a[200005], q[200005], hea, tai; //dp[i] = max{dp[k]} + w[i] | i r n l r; for(in 阅读全文
posted @ 2017-11-30 20:44 poorpool 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 单调队列优化dp cpp include include using namespace std; int dp[1000005], n, m, q[1000005], l, r, w[1000005]; //dp[i] = dp[j] + w[i] | i m n m; for(int i=1; 阅读全文
posted @ 2017-11-30 20:06 poorpool 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 模板题 cpp include include include using namespace std; int l1=1, r1, l2=1, r2, q1[1000005], q2[1000005], a[1000005], n, k; int ans1[1000005], ans2[10000 阅读全文
posted @ 2017-11-30 19:38 poorpool 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 找两个异或和最大的数 很容易想到trie树维护二进制 cpp include include include using namespace std; typedef long long ll; struct Node{ ll son[2], idd; bool hav[2]; Node(){ so 阅读全文
posted @ 2017-11-30 19:07 poorpool 阅读(95) 评论(0) 推荐(0) 编辑