10 2024 档案

摘要:G. Sakurako and Chefir Given a tree with $n$ vertices rooted at vertex $1$. While walking through it with her cat Chefir, Sakurako got distracted, and 阅读全文
posted @ 2024-10-25 17:44 onlyblues 阅读(84) 评论(0) 推荐(1)
摘要:小红的树上路径查询(hard) 题目描述 本题和 $hard$ 难度的区别是,询问的次数有多次! 小红拿到了一棵树,她有多次询问,每次询问输入一条简单路径 $x,y$,她想知道树上所有节点到该路径的最短路之和是多少,你能帮帮她吗? 定义节点到路径的最短路为:节点到路径上所有点的最短路中,值最小的那个 阅读全文
posted @ 2024-10-23 20:50 onlyblues 阅读(150) 评论(0) 推荐(0)
摘要:区间缩小 题目描述 给定一个正整数 $n$,我们初始设定两个变量 $l$ 和 $r$,其中 $l=1$,$r=n$。我们将执行以下步骤: 如果 $l=r$,则结束操作;否则,执行步骤 $2$。 从区间 $[l,r]$ 中等概率地选取一个正整数 $x$。然后,以下两种情况互斥地发生:以概率 $p$ 将 阅读全文
posted @ 2024-10-20 22:42 onlyblues 阅读(44) 评论(0) 推荐(1)
摘要:E. Card Game In the most popular card game in Berland, a deck of $n \times m$ cards is used. Each card has two parameters: suit and rank. Suits in the 阅读全文
posted @ 2024-10-16 19:34 onlyblues 阅读(116) 评论(0) 推荐(0)
摘要:k - 路径(mid vension) 题目描述 这是问题的中等版本。三个版本的做法之间可能有交集。 给定一颗 $n$ 个点的无根树,每个节点有类型和权值,分别用 $c$ 和 $w$ 表示。一条简单路径的权值为这条路径包含的节点权值之和。 对于一个长度为 $len+1(len>1)$ 的序列 $a$ 阅读全文
posted @ 2024-10-15 17:02 onlyblues 阅读(37) 评论(0) 推荐(0)
摘要:城中分支 题目描述 “城市处于建设中......” 预言之子的你获得了一个拥有 $n$ 个元素的数组。 天神赋予你 $q$ 次操作: $Modify$,$l$,$r$,$x$ 对于每个 $i$ $(l \leq i \leq r)$,将 $a_i$ 乘以 $x$ 。 $Query$,$l$,$r$ 阅读全文
posted @ 2024-10-07 22:20 onlyblues 阅读(23) 评论(0) 推荐(0)
摘要:E. Expected Power You are given an array of $n$ integers $a_1,a_2,\ldots,a_n$. You are also given an array $p_1, p_2, \ldots, p_n$. Let $S$ denote the 阅读全文
posted @ 2024-10-07 10:34 onlyblues 阅读(151) 评论(0) 推荐(0)
摘要:C2. Adjust The Presentation (Hard Version) This is the hard version of the problem. In the two versions, the constraints on $q$ and the time limit are 阅读全文
posted @ 2024-10-06 21:03 onlyblues 阅读(414) 评论(1) 推荐(0)

Web Analytics