
差分数组
xuanweiace
一个热爱算法竞赛的弱校ACMer路过。青大本,浙大硕,方向后端开发,菜鸡一枚,奋斗ing...
展开
-
【Gym - 101775J】Straight Master(差分,思维)
题干:A straight is a poker hand containing five cards of sequential rank, not necessarily to be the same suit. For example, a hand containing 7 club, 6 spade, 5 spade, 4 heart and 3 diamond forms a st...原创 2020-11-30 20:46:12 · 247 阅读 · 0 评论 -
【牛客 - 297C】little w and Segment Coverage(差分数组,区间差分,思维,卡线段树)☆
题干: 小w有m条线段,编号为1到m。用这些线段覆盖数轴上的n个点,编号为1到n。第i条线段覆盖数轴上的区间是L[i],R[i]。覆盖的区间可能会有重叠,而且不保证m条线段一定能覆盖所有n个点。现在小w不小心丢失了一条线段,请问丢失哪条线段,使数轴上没被覆盖到的点的个数尽可能少,请输出丢失的线段的编号和没被覆盖到的点的个数。如果有多条线段符合要求,请输出编号最大线段的编号(编...原创 2018-12-24 09:10:25 · 303 阅读 · 0 评论 -
【HDU - 6514】Monitor(二维差分,前缀和)
题干:MonitorTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 163840/163840 K (Java/Others)Total Submission(s): 872Accepted Submission(s): 145Problem DescriptionXiaoteng has a large a...原创 2019-04-23 14:39:47 · 345 阅读 · 0 评论 -
【HDU - 5452】Minimum Cut(树形dp 或 最近公共祖先lca+树上差分,转化tricks,思维)
题干:Given a simple unweighted graphGG(an undirected graph containing no loops nor multiple edges) withnnnodes andmmedges. LetTTbe a spanning tree ofGG.We say that a cut inGGrespectsTTi...原创 2019-07-11 14:41:59 · 301 阅读 · 0 评论 -
【Codeforces - 1000C】Covered Points Count(思维,离散化,差分)
题干:You are givennnsegments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested i...原创 2019-10-11 20:26:34 · 301 阅读 · 0 评论