
dfs
文章平均质量分 84
CCloth
这个作者很懒,什么都没留下…
展开
-
[博弈论][dfs]Poker Game:Decision 2022牛客多校第8场 D
Alice和Bob打德州扑克,开始时两人各有两张牌,之后轮流从6张牌构成的牌堆中抽牌,最终两人均有5张牌,根据题目给定的规则比较这5张牌大小,若两人能够看到各自的牌和牌堆中的牌,且以最优策略进行游戏,问最终胜者是谁。...原创 2022-08-14 17:13:24 · 360 阅读 · 0 评论 -
[dfs][思维]Infected Tree CF1689C
Byteland is a beautiful land known because of its beautiful trees.Misha has found a binary tree with nn vertices, numbered from 11 to nn. A binary tree is an acyclic connected bidirectional graph containing nn vertices and n−1n−1 edges. Each vertex has a d原创 2022-07-10 22:41:59 · 428 阅读 · 0 评论 -
[dfs][思维]Tree Queries CF1695D1&&D2
The only difference between this problem and D1 is the bound on the size of the tree.You are given an unrooted tree with nn vertices. There is some hidden vertex xx in that tree that you are trying to find.To do this, you may ask kk queries v1,v2,…,vk wher原创 2022-07-07 12:11:54 · 209 阅读 · 0 评论 -
[思维][dfs]Find the Maximum 第46届icpc区域赛昆明站F
A tree with nnn vertices is a connected undirected graph with nnn vertices and n−1n-1n−1 edges.You are given a tree with nnn vertices. Each vertex has a value bib_ibi. Note that for any two vertices there is exactly one single path between them, whereas a原创 2022-07-05 20:27:39 · 198 阅读 · 0 评论 -
[dfs][细节]二叉搜索树的结构 PTA L3-016
二叉搜索树或者是一棵空树,或者是具有下列性质的二叉树: 若它的左子树不空,则左子树上所有结点的值均小于它的根结点的值;若它的右子树不空,则右子树上所有结点的值均大于它的根结点的值;它的左、右子树也分别为二叉搜索树。(摘自百度百科)给定一系列互不相等的整数,将它们顺次插入一棵初始为空的二叉搜索树,然后对结果树的结构进行描述。你需要能判断给定的描述是否正确。例如将{ 2 4 1 3 0 }插入后,得到一棵二叉搜索树,则陈述句如“2是树的根”、“1和4是兄弟结点”、“3和0在同一层上”(指自顶向下的深度相同)原创 2022-03-25 13:17:51 · 305 阅读 · 0 评论 -
[记忆化搜索]那就别担心了 PTA L3-025
下图转自“英式没品笑话百科”的新浪微博 —— 所以无论有没有遇到难题,其实都不用担心。博主将这种逻辑推演称为“逻辑自洽”,即从某个命题出发的所有推理路径都会将结论引导到同一个最终命题(开玩笑的,千万别以为这是真正的逻辑自洽的定义……)。现给定一个更为复杂的逻辑推理图,本题就请你检查从一个给定命题到另一个命题的推理是否是“逻辑自洽”的,以及存在多少种不同的推理路径。例如上图,从“你遇到难题了吗?”到“那就别担心了”就是一种“逻辑自洽”的推理,一共有 3 条不同的推理路径。输入格式:输入首先在一原创 2022-03-20 14:52:25 · 305 阅读 · 0 评论 -
[dfs][凸包]The Fortified Forest POJ1873
Once upon a time, in a faraway land, there lived a king. This king owned a small collection of rare and valuable trees, which had been gathered by his ancestors on their travels. To protect his trees from thieves, the king ordered that a high fence be buil原创 2021-11-05 20:32:57 · 174 阅读 · 0 评论 -
[dfs]Gitignore 第45届icpc区域赛上海站M
Your git project (you don't need to be familiar with git to solve this problem) has some files that should be ignored from synchronizing. You need to calculate the minimum number of lines needed for gitignore.Formally, your project is a folder. A folder原创 2021-11-04 20:28:24 · 187 阅读 · 0 评论 -
[好题][半平面交][dfs]Nice Milk POJ1271
Little Tomy likes to cover his bread with some milk. He does this by putting it in the cup so that one of its sides (called bottom side) touches the bottom of the cup, just as the picture below:Since the milk in the cup is limited, only part of the br原创 2021-11-03 15:27:12 · 337 阅读 · 0 评论 -
[dfs]L2-020 功夫传人
一门武功能否传承久远并被发扬光大,是要看缘分的。一般来说,师傅传授给徒弟的武功总要打个折扣,于是越往后传,弟子们的功夫就越弱…… 直到某一支的某一代突然出现一个天分特别高的弟子(或者是吃到了灵丹、挖到了特别的秘笈),会将功夫的威力一下子放大N倍 —— 我们称这种弟子为“得道者”。这里我们来考察某一位祖师爷门下的徒子徒孙家谱:假设家谱中的每个人只有1位师傅(除了祖师爷没有师傅);每位师傅可以带很多徒弟;并且假设辈分严格有序,即祖师爷这门武功的每个第i代传人只能在第i-1代传人中拜1个师傅。我们假设已知祖师原创 2021-10-14 21:21:58 · 101 阅读 · 0 评论