刷题笔记
文章平均质量分 72
旧林墨烟
惠州学院大四学生,热爱算法竞赛,获得蓝桥杯、天梯赛、ccpc、icpc等多项奖项,熟悉c++、java语言,目前处于求职状态
展开
-
U - Tallest Cow (差分)
FJ’s N (1 ≤ N ≤ 10,000) cows conveniently indexed 1…N are standing in a line. Each cow has a positive integer height (which is a bit of secret). You are told only the height H (1 ≤ H ≤ 1,000,000) of the tallest cow along with the index I of that cow.FJ ha原创 2021-10-06 20:34:55 · 190 阅读 · 0 评论 -
T - Covered Points Count (差分)
You are given n segments 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 in each other or even coincide.Your task is the following: for原创 2021-10-06 19:19:22 · 115 阅读 · 0 评论 -
S - Karen and Coffee(前缀和)
To stay woke and attentive during classes, Karen needs some coffee!Karen, a coffee aficionado, wants to know the optimal temperature for brewing the perfect cup of coffee. Indeed, she has spent some time reading several recipe books, including the univer原创 2021-10-06 16:55:35 · 198 阅读 · 0 评论 -
R - Color the ball (前缀和)
N个气球排成一排,从左到右依次编号为1,2,3…N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗?Input每个测试实例第一行为一个整数N,(N <= 100000).接下来的N行,每行包括2个整数a b(1 <= a <= b <= N)。当N = 0,输入结束。Output每个测试实例输出一原创 2021-10-06 14:18:53 · 98 阅读 · 2 评论 -
Q - Conturbatio (前缀和)
There are many rook on a chessboard, a rook can attack the row and column it belongs, including its own place.There are also many queries, each query gives a rectangle on the chess board, and asks whether every grid in the rectangle will be attacked by an原创 2021-10-06 13:11:24 · 154 阅读 · 0 评论 -
P - CS Course (前缀和+后缀和)
Little A has come to college and majored in Computer and Science.Today he has learned bit-operations in Algorithm Lessons, and he got a problem as homework.Here is the problem:You are giving n non-negative integers a1,a2,⋯,an, and some queries.A query原创 2021-10-05 21:36:57 · 92 阅读 · 0 评论 -
O - Bound Found (前缀和+滑动窗口)
Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going through a defiant phase: “But I want to use feet, not meters!”). Each signal seems to come in two parts: a s原创 2021-10-05 20:27:55 · 162 阅读 · 0 评论 -
N - Maximum Subrectangle (前缀和)
You are given two arrays a and b of positive integers, with length n and m respectively.Let c be an n×m matrix, where ci,j=ai⋅bj.You need to find a subrectangle of the matrix c such that the sum of its elements is at most x, and its area (the total numbe原创 2021-10-05 20:12:04 · 149 阅读 · 0 评论