自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(90)
  • 收藏
  • 关注

原创 (HDU3295) An interesting mobile game- DFS+BFS

An interesting mobile gameTime Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 607    Accepted Submission(s): 291 Problem DescriptionXQ,one o...

2018-10-04 20:02:16 176

原创 (HDU1195) Open the Lock-BFS

Open the LockTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7603    Accepted Submission(s): 3397 Problem DescriptionNow an emergent tas...

2018-10-04 19:38:35 182

原创 (HDU2102) A计划-BFS

A计划Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 30320    Accepted Submission(s): 7589 Problem Description可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而...

2018-10-04 19:28:48 133

原创 (HDU2437) Jerboas-DFS-余数判重

JerboasTime Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2030    Accepted Submission(s): 558 Problem Description      Jerboas are small de...

2018-10-04 19:15:36 202

原创 (HDU2181) 哈密顿绕行世界问题-DFS

哈密顿绕行世界问题Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7428    Accepted Submission(s): 4408 Problem Description一个规则的实心十二面体,它的 20个顶点标出世...

2018-10-04 18:24:07 194

原创 (HDOJ3309)Roll The Cube-BFS

Roll The CubeTime Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 777    Accepted Submission(s): 326 Problem DescriptionThis is a simple game...

2018-10-03 17:17:39 139

原创 (HDU2614) Beat-DFS

BeatTime Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2441    Accepted Submission(s): 1395 Problem DescriptionZty is a man that always ful...

2018-10-03 13:04:50 148

原创 (HDU3839)Ancient Messages-dfs-连通块

Ancient Messages Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 999    Accepted Submission(s): 322   Problem Description In...

2018-10-03 11:53:15 259

原创 (HDU4101) Ali and Baba

Ali and BabaTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2591    Accepted Submission(s): 572 Problem DescriptionThere is a rectangle ...

2018-10-02 23:05:37 192

原创 (HDU2821)Pusher-DFS

PusherTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/65536 K (Java/Others)Total Submission(s): 1811    Accepted Submission(s): 674Special Judge Problem DescriptionPusherBoy is a...

2018-08-21 10:31:15 176

翻译 (HDU1664)Different Digits-BFS-余数判重

Different DigitsTime Limit: 10000/4000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1789    Accepted Submission(s): 541 Problem DescriptionGiven a positive...

2018-08-20 21:18:41 149

原创 (HDU1226)超级密码-BFS-同余剪枝

超级密码Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4976    Accepted Submission(s): 1621 Problem DescriptionIgnatius花了一个星期的时间终于找到了传说中的...

2018-08-20 11:47:53 249

原创 (HDU1885)Key Task-BFS-状态压缩

Key TaskTime Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2719    Accepted Submission(s): 1172 Problem DescriptionThe Czech Technical Univ...

2018-08-20 10:54:55 158

原创 (HDU1429)胜利大逃亡(续)-BFS-状态压缩

胜利大逃亡(续)Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10925    Accepted Submission(s): 3977 Problem DescriptionIgnatius再次被魔王抓走了(搞不懂他咋这...

2018-08-20 10:38:15 172

原创 (HDU4198)Quick out of the Harbour-BFS-优先队列

Quick out of the HarbourTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2025    Accepted Submission(s): 853 Problem DescriptionCaptain C...

2018-08-11 13:29:27 193

原创 (HDU5012)Dice-BFS

DiceTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2310    Accepted Submission(s): 1154 Problem DescriptionThere are 2 special dices on...

2018-08-11 13:00:38 165

原创 (HDU 1253)胜利大逃亡-BFS

胜利大逃亡Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 43543    Accepted Submission(s): 15146 Problem DescriptionIgnatius被魔王抓走了,有一天魔王出差去了,...

2018-08-11 12:39:39 134

原创 (POJ3278)Catch That Cow - BFS

                                                                                Catch That CowTime Limit: 2000MS   Memory Limit: 65536K Total Submissions: 118899   Accepted: 37103 De...

2018-08-11 12:25:55 116

原创 (POJ3126)Prime Path - BFS

                                                                                           Prime PathTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 27738   Accepted: 1515...

2018-08-11 08:52:05 114

原创 (HDU1010)Tempter of the Bone-DFS

Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 147039    Accepted Submission(s): 39216 Problem DescriptionThe doggie...

2018-08-05 18:33:56 104

翻译 (HDU1455)Sticks-DFS

                                            Sticks             Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)                           Total Submission(s): 131...

2018-08-05 11:22:20 127

原创 (HDU5547)Sudoku-DFS

                                                SudokuTime Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 3312    Accepted Submission(s): 1100 ...

2018-08-05 10:27:53 210

原创 (HDOJ)Friends-DFS

                                            FriendsTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2857    Accepted Submission(s): 1359 Pr...

2018-08-05 10:01:01 168

原创 奇偶剪枝(简陋的讲解证明)

                                                                                        奇偶剪枝【问题描述:】给定一个N*M的迷宫以及起点和终点,迷宫中有一些障碍无法穿过,问能否不重复也不停留地在刚好一共走T步出迷宫。 【问题分析:】先来看下这张图片: 也就是说当要走偶数步而规定...

2018-07-28 11:14:22 470

原创 (POJ1040)Transportation-DFS

                                          TransportationTime Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5047   Accepted: 2073 DescriptionRuratania is just entering ca...

2018-07-27 11:22:06 245

原创 (HDU2553)N皇后问题 经典DFS

                                           N皇后问题Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 32785    Accepted Submission(s): 14099 Pro...

2018-07-26 09:43:08 500

原创 (POJ2078)Matrix-DFS

                                                  MatrixTime Limit: 2000MS   Memory Limit: 30000K Total Submissions: 4254   Accepted: 2242 DescriptionGiven an n*n matrix A, whose e...

2018-07-26 09:15:53 191

原创 (POJ1950)Dessert-DFS

DescriptionFJ has a new rule about the cows lining up for dinner. Not only must the N (3 <= N <= 15) cows line up for dinner in order, but they must place a napkin between each pair of cows w...

2018-07-25 10:33:48 220

原创 (POJ1573)Robot Motion-DFS

DescriptionA robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions areN n...

2018-07-25 09:43:42 197

原创 (POJ1970)DFS-The Game

DescriptionA game of Renju is played on a 19*19 board by two players. One player uses black stones and the other uses white stones. The game begins in an empty board and two players alternate in pl...

2018-07-23 11:08:45 477

原创 DFS-Red and Black(POJ1979)

题目(http://poj.org/problem?id=1979)There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to on...

2018-07-23 09:21:30 128

翻译 棒球比赛

题目链接:https://leetcode-cn.com/problems/baseball-game/description/emmmm,一道水题,然而菜鸡的我当时自己都写不出来,这道题用到的栈的思想,这里用一个动态数组来模拟栈,当是数字时,直接将数字入栈,当是‘+’时将st.back()和st[st.size()-2]求和入栈,当是‘D’时,将st.back()*2入栈,当是‘C’时,栈顶元素...

2018-05-27 15:34:01 404

原创 L2-002.链表去重

分析:通过输入输出的样例可以知道,数据的存储不是真正的链表,通过思考观察不难想出用结构体数组来模拟链表,其中每个节点的地址用数组的下标来表示。知道怎样存储后接下来就是怎么去重,这里去重采用的标记的办法,既若该key值的绝对值第一次出现就将他标记,后面遍历链表若发现该key值已被标记则说明该key值代表的节点需要删去,这里用vol[100001]数组来进行标记,key值为数组的下标,删去的节点按顺序

2018-02-06 19:29:52 257

原创 剑指 Offer 68 - II. 二叉树的最近公共祖先

给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。百度百科中最近公共祖先的定义为:“对于有根树 T 的两个结点 p、q,最近公共祖先表示为一个结点 x,满足 x 是 p、q 的祖先且 x 的深度尽可能大(一个节点也可以是它自己的祖先)。”例如,给定如下二叉树: root = [3,5,1,6,2,0,8,null,null,7,4]示例 1:示例 2:说明:所有节点的值都是唯一的。p、q 为不同节点且均存在于给定的二叉树中。思路:后序遍历需要考虑到当前函数返回值的意义。对于该题,返回值代表当前节点

2022-07-07 10:13:03 244 1

原创 【Leetcode hot100】31. 下一个排列

整数数组的一个 排列 就是将其所有成员以序列或线性顺序排列。例如,arr = [1,2,3] ,以下这些都可以视作 arr 的排列:[1,2,3]、[1,3,2]、[3,1,2]、[2,3,1] 。整数数组的 下一个排列 是指其整数的下一个字典序更大的排列。更正式地,如果数组的所有排列根据其字典顺序从小到大排列在一个容器中,那么数组的 下一个排列 就是在这个有序容器中排在它后面的那个排列。如果不存在下一个更大的排列,那么这个数组必须重排为字典序最小的排列(即,其元素按升序排列)。例如,arr = [1,2

2022-05-31 22:17:23 230

原创 【Leetcode hot100】22. 括号生成

数字 n 代表生成括号的对数,请你设计一个函数,用于能够生成所有可能的并且 有效的 括号组合。示例 1:输入:n = 3输出:["((()))","(()())","(())()","()(())","()()()"]示例 2:输入:n = 1输出:["()"]提示:1 <= n <= 8来源:力扣(LeetCode)链接:https://leetcode.cn/problems/generate-parentheses思路:因为数据量比较.

2022-05-30 21:08:50 290

原创 【Leetcode hot100】20. 有效的括号

给定一个只包括 '(',')','{','}','[',']' 的字符串 s ,判断字符串是否有效。有效字符串需满足:左括号必须用相同类型的右括号闭合。左括号必须以正确的顺序闭合。示例 1:输入:s = "()"输出:true示例2:输入:s = "()[]{}"输出:true示例3:输入:s = "(]"输出:false示例4:输入:s = "([)]"输出:false示例5:输入:s = "{[]}"输出:...

2022-05-30 19:53:08 111

原创 【Leetcode hot100】19. 删除链表的倒数第 N 个结点

给你一个链表,删除链表的倒数第 n 个结点,并且返回链表的头结点。示例 1:输入:head = [1,2,3,4,5], n = 2输出:[1,2,3,5]示例 2:输入:head = [1], n = 1输出:[]示例 3:输入:head = [1,2], n = 1输出:[1]提示:链表中结点的数目为 sz1 <= sz <= 300 <= Node.val <= 1001 <= n <= sz来源.

2022-05-27 20:45:14 152

原创 【Leetcode hot100】15. 三数之和

给你一个包含 n 个整数的数组 nums,判断 nums 中是否存在三个元素 a,b,c ,使得 a + b + c = 0 ?请你找出所有和为 0 且不重复的三元组。注意:答案中不可以包含重复的三元组。示例 1:输入:nums = [-1,0,1,2,-1,-4]输出:[[-1,-1,2],[-1,0,1]]示例 2:输入:nums = []输出:[]示例 3:输入:nums = [0]输出:[]提示:0 <= nums.length <=

2022-05-27 20:04:42 149

原创 链表相关总结

2022-03-02 12:37:31 84

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除