摘要: 前言 最近在做图上随机游走的期望题时,发现不同的状态定义会得到不同结果。其中一个状态的定义与转移看上去都蛮对的,但实际是错误的,我看了好久都看不出来,最后手推才发现其中的问题,原因是混淆了条件期望与绝对期望。这次的推导过程让我受益匪浅,故将其记录下来。 案例引入 先引入一个简单的例子,给定一个 $4 阅读全文
posted @ 2026-04-28 21:51 onlyblues 阅读(111) 评论(0) 推荐(2)
摘要: Maximum Subarray Sum After at Most K Swaps You are given an integer array nums and an integer k. You are allowed to perform at most k swap operations 阅读全文
posted @ 2026-06-16 19:59 onlyblues 阅读(18) 评论(0) 推荐(0)
摘要: 心的爱「心」午餐 题目描述 虽在小镇上最受欢迎的折纸咖啡馆工作,身为料理技艺高超的老板娘的女儿,织部心的料理水平却不尽人意,她的料理能让人「深刻地感受到自己是活着的」。 一天,在诚外出采购时,心为了犒劳自己亲爱的「哥哥」,为诚做了一桌爱心午餐。 这份午餐有 $n$ 种料理。第 $i$ 种料理的美味值 阅读全文
posted @ 2026-05-30 22:06 onlyblues 阅读(13) 评论(0) 推荐(0)
摘要: G - Catch All Apples Problem Statement $N$ apples fall on a number line. Apple $i$ falls at coordinate $X_i$ at time $T_i$. You want to place some rob 阅读全文
posted @ 2026-05-17 17:28 onlyblues 阅读(13) 评论(0) 推荐(0)
摘要: F. Subtree Minimum Query You are given a rooted tree consisting of $n$ vertices. Each vertex has a number written on it; number $a_i$ is written on ve 阅读全文
posted @ 2026-05-07 21:54 onlyblues 阅读(22) 评论(0) 推荐(0)
摘要: F - Plan Holidays Problem Statement Takahashi is trying to decide his schedule for $N$ days. Initially, none of the days are holidays. He can repeat e 阅读全文
posted @ 2026-05-03 23:36 onlyblues 阅读(35) 评论(0) 推荐(0)
摘要: 芙莉莲的魔导书 题目描述 按照芙莉莲的研究,人类魔法按照难度构成一棵树,树根为 $1$ 号节点,人类对魔法的理解随时在演进,因此芙莉莲会对这棵树做并修改标记。 树上编号为 $i$ 的节点有标记 $a_i$,初始均为 $0$。 你需要维护两种操作: 芙莉莲会指定编号为 $x$ 的节点,将以这个节点为根 阅读全文
posted @ 2026-04-23 17:14 onlyblues 阅读(18) 评论(0) 推荐(0)
摘要: C. Willem, Chtholly and Seniorious — Willem... — What's the matter? — It seems that there's something wrong with Seniorious... — I'll have a look... S 阅读全文
posted @ 2026-04-17 11:25 onlyblues 阅读(20) 评论(0) 推荐(0)
摘要: 穿越鳌太线 题目描述 鳌太线是一条连接秦岭鳌山与太白山的高海拔徒步路线,以其变幻莫测的气候、陡峭的地形和稀薄的氧气而闻名,被称为"行走在中华龙脊"上的艰险之路。在这条路线上,每一处地形都对应着不同的探险难度和资源补给情况。 钒钒作为一名经验丰富的探险者,需要规划一条从起点到终点的安全路径。每到达一个 阅读全文
posted @ 2026-04-09 16:40 onlyblues 阅读(15) 评论(0) 推荐(0)
摘要: F - Grid Clipping Problem Statement There is a grid with $H$ rows and $W$ columns. The cell at the $r$-th row from the top and $c$-th column from the 阅读全文
posted @ 2026-03-26 17:23 onlyblues 阅读(13) 评论(0) 推荐(0)
Web Analytics