
bfs dfs
深度搜索广度搜索
xlx_llew
身为一个高冷的人,不需要简述。
展开
-
素数环
点击打开题目链接素数环时间限制:1000 ms | 内存限制:65535 KB难度:2描述有一个整数n,把从1到n的数字无重复的排列成环,且使每相邻两个数(包括首尾)的和都为素数,称为素数环。为了简便起见,我们规定每个素数环都从1开始。例如,下图就是6的一个素数环。输入有多组测试数据,每组输入一个n(0输出每组第一原创 2018-01-09 17:51:56 · 307 阅读 · 0 评论 -
prime path
题目链接:https://vjudge.net/contest/203942#problem/FF - Prime Path 题意就是让你将第一个数变成第二个数,每次只能变一个数字,然后,让你计算最少的次数,如果不可以变成另一个数的话就输出"Impossible",否则输出次数。代码:#include#include#incl原创 2018-01-02 21:16:12 · 860 阅读 · 0 评论 -
nyoj_58迷宫问题
题目链接:http://oj.nyist.me/OJ/contest_problem.php?cid=1038&pid=6G : 最少步数题目描述这有一个迷宫,有0~8行和0~8列: 1,1,1,1,1,1,1,1,1 1,0,0,1,0,0,1,0,1 1,0,0,1,1,0,0,0,1 1,0,1,0,1,1,0,1,1 1,0,0,0,0,1,0原创 2017-12-05 21:29:13 · 350 阅读 · 0 评论 -
部分和问题(入门题)
题目链接:http://oj.nyist.me/OJ/contest_problem.php?cid=1038&pid=1题目描述给你n个数(a1,a2,a3.......an) ,是否存在某一些数字加起来等于k,有就输出 "YES",否则输出 "NO"。数据范围:na1+a2+....an在int范围里面.输入多组输入每组第一行输入两个数n,k第二原创 2017-12-04 20:59:55 · 754 阅读 · 0 评论 -
hdu 1728 逃离迷宫
Problem Description 给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方向感的人,因此,她在行走过程中,不能...原创 2018-05-14 17:01:42 · 236 阅读 · 0 评论 -
HDU 1072 Nightmare (bfs dfs)
Problem DescriptionIgnatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb exp...原创 2018-05-15 21:23:19 · 390 阅读 · 0 评论 -
hdu 1104 Remainder
Problem DescriptionCoco is a clever boy, who is good at mathematics. However, he is puzzled by a difficult mathematics problem. The problem is: Given three integers N, K and M, N may adds (‘+’) M, s...原创 2018-07-30 11:24:33 · 262 阅读 · 0 评论