10 2024 档案
摘要:G. Sakurako and Chefir Given a tree with vertices rooted at vertex . While walking through it with her cat Chefir, Sakurako got distracted, and
阅读全文
摘要:小红的树上路径查询(hard) 题目描述 本题和 难度的区别是,询问的次数有多次! 小红拿到了一棵树,她有多次询问,每次询问输入一条简单路径 ,她想知道树上所有节点到该路径的最短路之和是多少,你能帮帮她吗? 定义节点到路径的最短路为:节点到路径上所有点的最短路中,值最小的那个
阅读全文
摘要:区间缩小 题目描述 给定一个正整数 ,我们初始设定两个变量 和 ,其中 ,。我们将执行以下步骤: 如果 ,则结束操作;否则,执行步骤 。 从区间 中等概率地选取一个正整数 。然后,以下两种情况互斥地发生:以概率 将
阅读全文
摘要:E. Card Game In the most popular card game in Berland, a deck of cards is used. Each card has two parameters: suit and rank. Suits in the
阅读全文
摘要:k - 路径(mid vension) 题目描述 这是问题的中等版本。三个版本的做法之间可能有交集。 给定一颗 个点的无根树,每个节点有类型和权值,分别用 和 表示。一条简单路径的权值为这条路径包含的节点权值之和。 对于一个长度为 的序列
阅读全文
摘要:E. Expected Power You are given an array of integers . You are also given an array . Let denote the
阅读全文
摘要:C2. Adjust The Presentation (Hard Version) This is the hard version of the problem. In the two versions, the constraints on and the time limit are
阅读全文