![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
文章平均质量分 81
-小小小小魔王-
小白上路ing……
展开
-
HDU1195——Open the Lock (BFS)
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1195 #include<iostream>#include<cstdio>#include<cstring>#include<queue>using namespace std;struct node{ int num[4],s...原创 2018-05-21 20:19:50 · 197 阅读 · 0 评论 -
HDU1312——Red and Black (DFS)
Red and BlackTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12907 Accepted Submission(s): 7983Problem DescriptionThere is a rectangular room...原创 2018-05-27 20:04:43 · 101 阅读 · 0 评论 -
POJ1426——Find The Multiple (BFS)
Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there...原创 2018-05-23 19:32:50 · 108 阅读 · 0 评论 -
HDU1241——Oil Deposits (DFS)
题目:The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvCompworkswithonelargerectangularregionoflandatatime,andcreatesagridthatdivides the land into nu...原创 2018-05-23 20:20:42 · 162 阅读 · 0 评论 -
HDU1143——Tri Tiling(DP)
题目: http://acm.hdu.edu.cn/showproblem.php?pid=1143思路:把大矩形用竖线切出左边一部分,然后递归求解,竖线是沿着纹路分的,右面就是f(n-2)有三种情况,即3*f(n-2)。左面是f(n-4),只有两种情况(注意左面再分是,是不可以出现一条竖线可以切分的情况,所以只有两种情况)。递推公式出现:f(n)=3*f(n-2)+2*f(n-4)+…+...原创 2018-10-29 20:07:15 · 144 阅读 · 0 评论 -
HDU2544——最短路(最短路Dijkstra)
http://acm.hdu.edu.cn/showproblem.php?pid=2544题意描述:A,B为路口编号,C为AB之间的权值,计算最短路Floyd方法#include <stdio.h>#include <cstring>#include <string.h>#include <iostream>using na...原创 2018-11-03 10:29:44 · 192 阅读 · 0 评论 -
STL——Binary search(二分查找)
转自:http://www.cnblogs.com/wkfvawl/p/9475939.html二分算法模板:while (left <= right) { int mid = (left + right) / 2; if (array[mid] == key) { return mid; } ...转载 2019-03-01 18:41:56 · 140 阅读 · 0 评论 -
DFS
转自:https://www.cnblogs.com/OctoptusLian/p/7429645.htmlvoid dfs(int x,int y,int step){ int tx,ty; int next[4][2]= {{-1,0},{1,0},{0,-1},{0,1}}; if(x==endx &&y==endy) { ...转载 2019-03-02 19:53:24 · 125 阅读 · 0 评论