• 2024-06-07Dragon_Knight_CTF-stack(栈迁移)
    Dragon_Knight_CTF-stack(栈迁移)程序的保护情况如下,可以看到没有开启pie保护Arch:amd64-64-littleRELRO:PartialRELROStack:NocanaryfoundNX:NXenabledPIE:NoPIE(0x3fe000)可以看道main函数也很简洁,只有一个0x10大小的溢出,程序给了libc,版
  • 2024-02-22DFS算法模板(2488:A Knight's Journey)
    DFS算法(C++版本)题目一:链接:http://bailian.openjudge.cn/practice/2488/解析思路:骑士找路就是基本的DFS,用递归不断找到合适的路,找不到就回头直到找到合适的路。该题难点:要是实现字典序,也就是同样的两种选择,要走到A1而不是B1。所以就有了{-1,-2},{1,-2},{-2,-1},{2,-1},{-2,1
  • 2024-02-03A Knight's JourneyC++
    题目看半天看不懂。題目把我恶心坏了。看网上说按字典顺序输出,到底是什么意思半天没搞懂。#include<iostream>#include<string>usingnamespacestd;intd[8][2]={{-1,-2},{1,-2},{-2,-1},{2,-1},{-2,1},{2,1},{-1,2},{1,2}};intvisit[8][8]={0};boolDFS(i
  • 2023-09-18【POJ 2488】A Knight‘s Journey 题解(深度优先搜索)
    背景骑士厌倦了一次又一次地看到同样的黑白方块,决定去旅行全世界每当骑士移动时,它是一个方向上的两个正方形和一个垂直于这个方向的正方形。骑士的世界就是他生活的棋盘。我们的骑士生活在一个棋盘上,这个棋盘的面积比普通的8*8棋盘小,但它仍然是矩形的。你能帮助这位冒险的骑士制
  • 2023-09-12hdu 1372 Knight Moves 骑士的移动 bfs--马走日
    #include<stdio.h>#include<string.h>#include<queue>usingnamespacestd;charss[3],ee[3];intx1,y1,x2,y2;structpos{intx,y,step;}sta,end;intf[10][10];intdir[8][2]={1,2,1,-2,-1,2,-1,-2,2,1,2,-1,-2,1,-2,-1};boolfan
  • 2023-08-27hdu:Knight Moves(bfs)
    ProblemDescriptionAfriendofyouisdoingresearchontheTravelingKnightProblem(TKP)whereyouaretofindtheshortestclosedtourofknightmovesthatvisitseachsquareofagivensetofnsquaresonachessboardexactlyonce.Hethinksthatthe
  • 2023-05-24A Knight's Journey
    [提交][状态]题目描述Theknightisgettingboredofseeingthesameblackandwhitesquaresagainandagainandhasdecidedtomakeajourneyaroundtheworld.Wheneveraknightmoves,itistwosquaresinonedirectionandonesquareperpendiculartoth
  • 2023-05-02UVA 12177 First Knight
    (提醒:原题面是\(m\)行\(n\)列,这里改成了\(n\)行\(m\)列)首先很好想到设\(dp_{u,v}\)为\((u,v)\)的期望步数\(dp_{u,v}=\begin{cases}\sum_{i=1}^4dp_{u+du_i,v+dv_i}\timesp_i&(u\not=n\operatorname{or}v\not=m)\\0&(u=n\operator
  • 2023-01-30Knight Moves POJ-1915 <bfs>
    KnightMovesTimeLimit: 1000MS MemoryLimit: 30000KTotalSubmissions: 37011 Accepted: 17105DescriptionBackgroundMrSomurolov,fabulous
  • 2022-12-24马的移动
    小明很喜欢下国际象棋,一天,他拿着国际象棋中的“马”时突然想到一个问题:给定两个棋盘上的方格A和B,马从A跳到B最少需要多少步?现请你编程解决这个问题。提示:国际象棋棋盘为8
  • 2022-12-06poj2243 Knight Moves--A*
    原题链接:​​http://poj.org/problem?id=2243​​题意:给定一个起始点和目标点,求按照“日”字走法,最少的步骤。#define_CRT_SECURE_NO_DEPRECATE#include<iostream>#includ
  • 2022-11-28骑士的移动(Knight Moves)
    ​​KnightMoves​​TimeLimit:3000MS MemoryLimit:Unknown 64bitIOFormat:%lld&%llu​​Submit ​​​​Status​​Description​​​​Afriendofyou