随笔分类 -  图论--搜索

摘要:传送门 题意:给定n条边,连接编号从1到1e9之间的点,一次操作可以改变一条边连接的一个端点到另一个端点,也就是将第i条边(u,v)变成(u,w),v≠w,问最少次数操作使得这张图的所有边联通,输出操作次数k,以及每次操作的i,v,w。 分析:先将点离散化。假设有n个联通块s1,s2....sn,可 阅读全文
posted @ 2019-10-31 22:28 千摆渡Qbd 阅读(611) 评论(0) 推荐(0) 编辑
摘要:传送门 题意:给定无向连通图和起点S,每个点有权值,求遍历无向图得到的最大权值和。但是不能走回头路,即如果从U走到V那么下一步不可以从V走到U。 分析:将图分成两种组成,一种是环,一种是链。对于S所在的环,肯定可以遍历这个环回到S。对于其他的环,肯定可以走到这个环中,遍历这个环,然后原路返回。那么最 阅读全文
posted @ 2019-09-19 17:57 千摆渡Qbd 阅读(375) 评论(0) 推荐(0) 编辑
摘要:We've got a rectangular n × m-cell maze. Each cell is either passable, or is a wall (impassable). A little boy found the maze and cyclically tiled a p 阅读全文
posted @ 2019-02-18 20:51 千摆渡Qbd 阅读(274) 评论(0) 推荐(0) 编辑
摘要:传送门 The Robotics Olympiad teams were competing in a contest. There was a tree drawn on the floor, consisting of n nodes and n - 1 edges. The nodes are 阅读全文
posted @ 2019-02-16 10:24 千摆渡Qbd 阅读(186) 评论(0) 推荐(0) 编辑
摘要:Kilani is playing a game with his friends. This game can be represented as a grid of size n×mn×m, where each cell is either empty or blocked, and ever 阅读全文
posted @ 2019-01-26 09:25 千摆渡Qbd 阅读(326) 评论(0) 推荐(0) 编辑
摘要:A - Lake Counting POJ - 2386 题意:W是水洼,连起来的W算同一个水洼(是九宫格内的连起来) 解题思路:dfs搜索,搜索不到了就继续,每一个dfs都可以搜到一个水坑,简而言之,总的dfs的次数就是水坑的个数(dfs重新调用的dfs不算) #include<iostream> 阅读全文
posted @ 2019-01-20 21:35 千摆渡Qbd 阅读(341) 评论(0) 推荐(0) 编辑
摘要:A计划 hdu2102 可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。 阅读全文
posted @ 2018-11-11 14:33 千摆渡Qbd 阅读(222) 评论(0) 推荐(0) 编辑
摘要:Pots Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22688 Accepted: 9626 Special Judge Description You are given two pots, having the volu 阅读全文
posted @ 2018-09-08 09:51 千摆渡Qbd 阅读(253) 评论(0) 推荐(0) 编辑
摘要:迷宫问题 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 34227 Accepted: 19479 Description 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 阅读全文
posted @ 2018-09-06 09:57 千摆渡Qbd 阅读(138) 评论(0) 推荐(0) 编辑
摘要:非常可乐 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23273 Accepted Submission(s): 9485 Problem D 阅读全文
posted @ 2018-09-01 09:11 千摆渡Qbd 阅读(148) 评论(0) 推荐(0) 编辑
摘要:Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Help J 阅读全文
posted @ 2018-08-31 21:12 千摆渡Qbd 阅读(277) 评论(0) 推荐(0) 编辑
摘要:Problem 2150 Fire Game Accept: 3772 Submit: 12868Time Limit: 1000 mSec Memory Limit : 32768 KB Accept: 3772 Submit: 12868Time Limit: 1000 mSec Memory 阅读全文
posted @ 2018-08-31 19:43 千摆渡Qbd 阅读(214) 评论(0) 推荐(0) 编辑
摘要:Prime Path Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 987 Accepted Submission(s): 635 Proble 阅读全文
posted @ 2018-08-31 19:34 千摆渡Qbd 阅读(269) 评论(0) 推荐(0) 编辑
摘要:Find The Multiple Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 42035 Accepted: 17654 Special Judge Description Given a positive integer 阅读全文
posted @ 2018-08-30 09:59 千摆渡Qbd 阅读(177) 评论(0) 推荐(0) 编辑
摘要:Dungeon Master Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 48605 Accepted: 18339 Description You are trapped in a 3D dungeon and need t 阅读全文
posted @ 2018-08-29 21:53 千摆渡Qbd 阅读(195) 评论(0) 推荐(0) 编辑
摘要:Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 148156 Accepted Submission(s) 阅读全文
posted @ 2018-08-19 10:52 千摆渡Qbd 阅读(158) 评论(0) 推荐(0) 编辑
摘要:In this task Anna and Maria play a game with a very unpleasant rival. Anna and Maria are in the opposite squares of a chessboard (8 × 8): Anna is in t 阅读全文
posted @ 2018-08-19 10:32 千摆渡Qbd 阅读(272) 评论(0) 推荐(0) 编辑
摘要:逃离迷宫 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 34147 Accepted Submission(s): 8333 Problem D 阅读全文
posted @ 2018-08-19 10:12 千摆渡Qbd 阅读(121) 评论(0) 推荐(0) 编辑
摘要:Find a way Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23967 Accepted Submission(s): 7823 Pro 阅读全文
posted @ 2018-08-19 10:03 千摆渡Qbd 阅读(116) 评论(0) 推荐(0) 编辑
摘要:7 パズル ime limit1000 ms Memory limit131072 kB OSLinux Source3rd PC Koshien, Final 7 パズルは 8 つの正方形のカードとこれらのカードがぴたりと収まる枠で構成されています。それぞれのカードには、互いに区別できるように 0 阅读全文
posted @ 2018-08-19 09:43 千摆渡Qbd 阅读(102) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示