dfs
Libra_Glow
不学dp是没有前途的(逃
展开
-
upc PinkRabbit寻找妹子 dfs + 玄学优化
问题 E: PinkRabbit寻找妹子时间限制: 1 Sec 内存限制: 128 MB[提交] [状态]题目描述PinkRabbit的表白成功了,为了腾出更多的时间和妹子聊天,PinkRabbit设计了一个被称为「TheHollow」(空洞者)的人工智能。这个人工智能表现出了远远超出这个时代所能拥有技术水平。它可以实现很多很神奇的功能,它的源代码就连Jeff Dean看了也要啧啧称赞。在有n个路口和m条街道的F市,PinkRabbit找到了一家工厂,为「The Hollow」设计了一台载具「T原创 2020-05-19 21:43:56 · 383 阅读 · 0 评论 -
有理数树 递归
十九世纪的时候,Moriz Stern (1858)与Achille Brocot (1860)发明了“一棵树”。据说,经由一些简单的规则而产生的这一棵树上,可以包含零以上所有的有理数。这棵树看起来大致这样:你观察出规则了吗?首先,他们在第一列放两个“分数”,第一个是0 / 1,代表0;第二个是1 / 0,代表无穷大。接着他们一列一列地产生这棵树,当他们要产生第k+1列的时候,就先把前k列所...原创 2020-04-01 14:36:22 · 2939 阅读 · 0 评论 -
Coloring Edges on Treedfs 着色
问题 K: Coloring Edges on Tree时间限制: 1 Sec 内存限制: 128 MB Special Judge[提交] [状态]题目描述Given is a tree G with N vertices. The vertices are numbered 1 through N, and the i-th edge connects Vertex ai and ...原创 2020-03-21 21:42:27 · 242 阅读 · 0 评论 -
CodeForce 377A dfs Maze
Pavel loves grid mazes. A grid maze is an n × m rectangle maze where each cell is either empty, or is a wall. You can go from one cell to another only if both cells are empty and have a common side.P...原创 2020-02-02 21:25:52 · 185 阅读 · 0 评论