上一页 1 ··· 53 54 55 56 57 58 59 60 61 ··· 82 下一页
摘要: 应用: 查询修改的历史性问题 查询第几大问题。 知识点: 值域线段树(每一个节点代表一个值域,储存在这个值域的数量(主席树要离散化)) 将区间上的每一个点当成一个树, 在增添一个树的时候,树中有很多重复的地方,重复的地方就直接共用,新的地方就新增。 代码: #include <bits/stdc++ 阅读全文
posted @ 2022-03-17 19:01 VxiaohuanV 阅读(53) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2022-03-17 08:46 VxiaohuanV 阅读(0) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2022-03-16 21:07 VxiaohuanV 阅读(0) 评论(0) 推荐(0)
摘要: 思路: 要相等,就一定会减去他们的总的差值, 前/后 缀后来处理 左右2边差值的权值。 最后更新答案即可。 题目: SWJTU—春季集训 - Virtual Judge (vjudge.net) #include <bits/stdc++.h> using namespace std; #defin 阅读全文
posted @ 2022-03-16 21:03 VxiaohuanV 阅读(56) 评论(0) 推荐(0)
摘要: 思路: 重点是染色,不用先把贪心的点拉出来染色(这样之后不好染其他的点) 直接谁便一个点开始DFS染色,遇到贪心的点特判一下就OK了。 题目:SWJTU—春季集训 - Virtual Judge (vjudge.net) #include <bits/stdc++.h> using namespac 阅读全文
posted @ 2022-03-16 20:59 VxiaohuanV 阅读(24) 评论(0) 推荐(0)
摘要: You are given a weighted tree consisting of nn vertices. Recall that a tree is a connected graph without cycles. Vertices u_iu i ​ and v_iv i ​ are co 阅读全文
posted @ 2022-03-16 15:21 VxiaohuanV 阅读(48) 评论(0) 推荐(0)
摘要: 2020 is the current year and is a leap year starting on Wednesday of the Gregorian calendar, the 2020th year of the Common Era (CE) and Anno Domini (A 阅读全文
posted @ 2022-03-14 19:41 VxiaohuanV 阅读(129) 评论(0) 推荐(0)
摘要: Lzw is having the Operations Research class now. Today the teacher is talking about the bin packing problem and some approximation algorithms to solve 阅读全文
posted @ 2022-03-14 19:20 VxiaohuanV 阅读(82) 评论(0) 推荐(0)
摘要: 修改 查询的复杂度 ln (黑红二叉树) 查找大于等于他,或者大于他。 map<int,int>:: iterator p=q.lower_bound(val[i]); P->first/second (key,val) View Code 还有一个当 lower_bound 不到的时候就是 p== 阅读全文
posted @ 2022-03-14 19:17 VxiaohuanV 阅读(37) 评论(0) 推荐(0)
摘要: You are given four positive integers nn , mm , aa , bb ( 1 \le b \le n \le 501≤b≤n≤50 ; 1 \le a \le m \le 501≤a≤m≤50 ). Find any such rectangular matr 阅读全文
posted @ 2022-03-14 11:02 VxiaohuanV 阅读(40) 评论(0) 推荐(0)
上一页 1 ··· 53 54 55 56 57 58 59 60 61 ··· 82 下一页