
算法_搜索
文章平均质量分 81
NJUTONY
吉林大学09级软件学院南京大学计算机研究生在读
展开
-
1509: Hamiltonian Cycle(深搜)
ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K42799Standard<br />A few definitions first:Definition 1A graph G = (V, E) is called ``dense'' if for each pair of non-adjacentvertices u and v, where n = |V| anddenotes the de原创 2010-11-27 12:03:00 · 545 阅读 · 0 评论 -
hdu1026 Ignatius and the Princess I(广度优先搜索)
Problem DescriptionThe Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into feng5166's castle. The castle is a large labyrinth. To make the problem simply, we assume the labyrinth is a原创 2011-04-27 07:43:00 · 944 阅读 · 0 评论 -
hdoj1045(FireNet 深搜)
Fire Net<br />Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)<br />Total Submission(s): 1996 Accepted Submission(s): 1159<br /><br />Problem DescriptionSuppose that we have a square city with straight streets. A map o原创 2011-05-13 09:52:00 · 1228 阅读 · 1 评论 -
joj1197(深搜,Sum it up)
1197: Sum It UpResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K640256Standard<br />Given a specified total t and a list of n integers, find all distinct sumsusing numbers from the list that add up to t. For example,if t = 4, n =原创 2010-11-03 21:35:00 · 950 阅读 · 0 评论 -
数独求解(深搜)
import java.util.*;public class SudokuSol { /**待求解数独,输入时,待填框中填0**/ static int[][] Matrix=null; /**对框中数字的标记,ind[i][j]==1,表示数字是固定的,ind[i][j]==0,数字是待填的**/ static int[][] ind=null; /**标记是否找到答案*原创 2014-03-22 00:38:31 · 849 阅读 · 0 评论 -
LeetCode Path Sum II
题目描述:https://oj.leetcode.com/problems/path-sum-ii/原创 2014-08-29 16:23:44 · 582 阅读 · 0 评论 -
LeetCode PathSum
题目描述:https://oj.leetcode.com/problems/path-sum/原创 2014-08-29 16:17:25 · 651 阅读 · 0 评论 -
LeetCode PalindromePartitioning
题目描述:https://oj.leetcode.com/problems/palindrome-partitioning/给定一个字符串,要求求出该串的所有回文分割方式。其实就是对该字符串的划分树进行深package PalindromePartitioning;import java.util.*;public class Solution { boolean isPalind原创 2014-08-29 16:36:07 · 499 阅读 · 0 评论 -
LeetCode Binary Tree Zigzag Level Order Traversal
题目链接:https://oj.leetcode.com/problems/binary-tree-zigzag-level-order-traversal/原创 2014-09-13 10:17:00 · 513 阅读 · 0 评论 -
LeetCode Permutations
题目描述:https://oj.leetcode.com/problems/permutations/原创 2014-09-13 10:39:08 · 604 阅读 · 0 评论 -
LeetCode Permutations II
题目描述:https://oj.leetcode.com/problems/permutations-ii/原创 2014-09-13 10:53:49 · 630 阅读 · 0 评论 -
深度优先搜索(临界表实现)
<br />#include<iostream>using namespace std;int color[100];int father[100];int b[100];//存储开始探查时间int f[100];//存储结束探查时间int time;struct node{ int m; node* next; node(int n,node* p){ m=n; next=p; }};struc原创 2011-04-24 19:11:00 · 626 阅读 · 0 评论 -
广度优先搜索(临界表实现)
<br />#include<iostream>#include<queue>using namespace std;int father[100];int d[100];int color[100];const int MAX=1000;struct node{ int m; node* next; node(int n,node* p){ m=n; next=p; }};node* p;s原创 2011-04-24 08:47:00 · 585 阅读 · 0 评论 -
zoj1649Rescue
RescueTime Limit: 1 Second Memory Limit: 32768 KB Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M Angels friends want to save原创 2011-06-03 21:15:00 · 588 阅读 · 0 评论 -
hdoj1016(深搜,素数环)
Prime Ring Problem<br />Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)<br />Total Submission(s): 6795 Accepted Submission(s): 3057<br /><br />Problem DescriptionA ring is compose of n circles as shown in diagram.原创 2010-11-03 19:15:00 · 762 阅读 · 0 评论 -
joj1182 Lotto (求子集,深搜)
1182: LottoResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s8192K748353Standard<br />In a Lotto I have ever played, one has to select 6 numbers from the set {1,2,...,49}. A popular strategy to play Lotto - although it doesn't increase your chance原创 2010-11-08 15:05:00 · 587 阅读 · 0 评论 -
hdu 1240 Asteroids!
Asteroids!<br />Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)<br />Total Submission(s): 1233 Accepted Submission(s): 809<br /><br />Problem DescriptionYou're in space.<br />You want to get home.<br />There are原创 2010-11-13 23:41:00 · 736 阅读 · 0 评论 -
joj1349 Oil Deposits
1349: Oil DepositsResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K533260Standard<br />The GeoSurvComp geologic survey company is responsible for detectingunderground oil deposits. GeoSurvComp works with one large rectangularregion of land原创 2010-11-18 12:10:00 · 536 阅读 · 0 评论 -
joj2603 世界末日
2603: 2012世界末日ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE10s65536K22786Standard<br /> 种种迹象表明,公元2012年为世界末日,而科学家们进一步预测,人类将被一种神秘的时空机器送到另一个宇宙,所以不要害怕,我们只是搬了个新家而已~<br /> 每一次改变都是一种进步,这个新的世界并不像我们的地球,不再有南方北方(不倒翁已为此头疼很久),不再有贫富贵贱,人们也不会再因为自己的长像头疼,因为同性别的原创 2010-11-19 11:25:00 · 575 阅读 · 0 评论 -
joj1066Fire Net II
1066: Fire Net IIResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K535212Standard<br />1st JOJ Cup Online VContest Warmup Problem<br />Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n colu原创 2010-11-17 13:46:00 · 461 阅读 · 0 评论 -
hdoj1010 Tempter of the Bone(深度优先搜索)
Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone was a trap, and he tried desperately原创 2011-05-12 12:14:00 · 838 阅读 · 0 评论 -
hdoj1015Safecracker(深度优先搜索)
Problem Description=== Op tech briefing, 2002/11/02 06:42 CST === <br />"The item is locked in a Klein safe behind a painting in the second-floor library. Klein safes are extremely rare; most of them, along with Klein and his factory, were destroyed in Wor原创 2011-05-12 12:18:00 · 946 阅读 · 0 评论 -
poj1979Red and Black(广度优先搜索)
Red and BlackTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 14020 Accepted: 7218<br />DescriptionThere 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原创 2011-05-27 09:25:00 · 759 阅读 · 0 评论 -
zoj2412Farm Irrigation(深搜)
Farm IrrigationTime Limit: 1 Second Memory Limit: 32768 KB <br />Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these squares. Different square has a di原创 2011-05-28 09:42:00 · 601 阅读 · 0 评论 -
LeetCode Palindrome Partitioning
题目描述:https://oj.leetcode.com/problems/palindrome-partitioning/原创 2014-09-13 10:29:17 · 601 阅读 · 0 评论