常用
feng鸽
一点点的成长,最终会成为参天大树.
展开
-
BFS
#include <iostream>#include <queue>#define N 5using namespace std;int maze[N][N]={{0,1,1,0,0},{0,0,1,1,0},{0,1,1,1,0},{0,0,1,1,0}};int visited[N+1]={0};void BFS(int start){ queue<int...原创 2018-04-06 15:36:14 · 115 阅读 · 0 评论 -
DFS
#include <iostream>#include <stack>#define N 5using namespace std;int maze[N][N] ={ {0,1,1,0,0}, {0,0,1,0,1}, {0,0,1,0,0}, {1,1,0,0,1}, {0,0,1,0,0}};int visited[N+1]={0};void DFS...原创 2018-04-06 16:08:40 · 115 阅读 · 0 评论 -
动态规划
copy#include <iostream> #include <algorithm> using namespace std; #define MAX 101 int D[MAX][MAX]; int n; int maxSum[MAX][MAX]; int main(){ int i,j; ...原创 2018-04-07 12:55:41 · 113 阅读 · 0 评论 -
Python
Python中默认的编码格式是 ASCII 格式,在没修改编码格式时无法正确打印汉字,所以在读取中文时会报错。解决方法为只要在文件开头加入 # -*- coding: UTF-8 -*- 或者 #coding=utf-8 就行了...原创 2018-05-17 23:23:33 · 141 阅读 · 0 评论