原创 hdu--1711--kmp應用在整形數組--Number Sequence

/* Name: hdu--1711--Number Sequence Author: shen_淵 Date: 16/04/17 19:58 Description: 第一次知道,KMP能用在整形數組 o(╯□╰)o */

原创 116.hdu--2084--數塔

#include<iostream> #include<cstring> using namespace std; const static int N = 101; int ar[N][N] = {0}; void dp(int,in

原创 NYOJ--488--dfs--素數環

/* Name: NYOJ--488--素數環 Author: shen_淵 Date: 15/04/17 15:30 Description: DFS,素數打個表,37以內就夠用了 */ #include<cstring>

原创 117.hdu--2629--Identity Card

#include<iostream> #include<map> using namespace std; int main() { map<string,string> m; m["33"] = "Zhejiang"; m["1

原创 NYOJ--95--multiset--衆數問題

/* Name: NYOJ--95--衆數問題 Author: shen_淵 Date: 20/04/17 16:02 Description: multiset水過 */ #include<set> #include<iost

原创 118.poj-2287---Tian Ji -- The Horse Racing

#include<iostream> #include<algorithm> using namespace std; bool cmp(const int,const int); int king[3000] = {0}; int

原创 NYOJ--325--深度優先搜索--zb的生日

/* Name: NYOJ--325--zb的生日 Author: shen_淵 Date: 15/04/17 08:18 Description: 輸入時計算總質量,DFS搜索和總質量差值一般最接近的質量和,當val已經大於總

原创 NYOJ--202--紅黑樹

/* Name: NYOJ--202--紅黑樹 Author: shen_淵 Date: 14/04/17 18:31 Description: 用結構體模擬二叉樹的節點,因爲左旋右旋不影響中序遍歷,所以直接中序遍歷 */

原创 NYOJ--1100--WAJUEJI which home strong!

/* Name: NYOJ--1100--WAJUEJI which home strong! Author: shen_淵 Date: 15/04/17 21:02 Description: bfs+優先隊列 ,這是一道水題,

原创 NYOJ--353--bfs+優先隊列--3D dungeon

/* Name: NYOJ--3533D dungeon Author: shen_淵 Date: 15/04/17 15:10 Description: bfs()+優先隊列,隊列也能做,需要開一個vis[35][35][35

原创 NYOJ--284--廣搜+優先隊列--坦克大戰

/* Name: NYOJ--284--坦克大戰 Author: shen_淵 Date: 14/04/17 19:08 Description: 廣度優先搜索+優先隊列 注意清空地圖 對輸入地圖進行了預處理,

原创 NYOJ--927--搜索--The partial sum problem

/* Name: NYOJ--927--The partial sum problem Author: shen_淵 Date: 15/04/17 19:41 Description: DFS,和 NYOJ--1058--dfs

原创 114.hdu--1241--Oil Deposits

很入門的深搜: #include<iostream> #include<cstring> using namespace std; void dfs(int,int); int a[8][2]={ {-1,-1}, {-1,0}, {-1

原创 120.POJ--1088--滑雪

#include<iostream> using namespace std; const static int N = 102; int map[N][N] = {0}; int mar[N][N] = {0}; int dp(int,

原创 115.hdu--1421--搬寢室

注意:dp[i][j]初始化的時候不能小於0xffffff明顯大於2^15但是吧再小就WA了#include<iostream> #include<algorithm> #include<cstring> using namespace