原创 對對碰鼠標點擊--隨機版

//定義客戶端和鼠標座標全局變量int width,height,x,y,x00,y00;HWND myhwnd;//定義鼠標座標等信息WINUSERAPIVOIDWINAPImouse_event(   DWORD dwFlags,  

原创 hdu--1342 lotto(回溯法)

#include "stdio.h" #include "string.h" #include "math.h" int main() { int i,j,n,f=0; int a[13],b[6]; while(scanf("%

原创 1316 字符串匹配,a中包含多少個b字符串

#include "stdio.h" #include "math.h" #include "string.h" int main() { int i,j,len1,len2,count,t,temp; char n[52],m[52

原创 編程啦-1420 給定邊求BFS

#include "iostream" #include "queue" #include "string.h" using namespace std; int k,m; int vis[100][100],mark[100]; i

原创 使用鍵盤關掉窗口的方法

void CMy2View::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { // TODO: Add your message handler code here and/or ca

原创 迷宮--矩陣中任意兩點之間最短路-4個方向(dfs)

//求一個矩形中任意兩點之間的最短路(4個方向)+記錄路徑 #include "stdio.h" #include "math.h" #include "string.h" #include "stdlib.h" #include "ti

原创 馬踏棋盤3--求任意兩點之間最短路

#include "stdio.h" #include "math.h" #include "string.h" int mark[100][100],savex[1000],savey[1000],minx[1000],miny[100

原创 hdu--1372 knight moves (BFS+數據結構)

#include "iostream" #include "queue" using namespace std; int dir[8][2]={1,2,1,-2,2,1,2,-1,-1,2,-1,-2,-2,1,-2,-1}; int

原创 迷宮2--矩陣中任意兩點最短路(8個方向) dfs 效率很低

//求一個矩形中任意兩點之間的最短路(8個方向)+記錄路徑 dfs 效率很低 #include "stdio.h" #include "math.h" #include "string.h" #include "stdlib.h" #in

原创 迷宮3--快速求解任意兩點之間一條路,並不是最短(dfs)

//求一個矩形中任意兩點之間的隨便一條路(8個方向)+記錄路徑 dfs #include "stdio.h" #include "math.h" #include "string.h" #include "stdlib.h" #inclu

原创 pku--3278 catch the cow(*2 +1 -1 順序抓補)

#include "iostream" #include "math.h" #include "queue" using namespace std; long mark[210000]; struct node{ long num

原创 pku--3278 catch the cow 方法二 不用結構體(BFS)

#include "iostream" #include "math.h" #include "queue" using namespace std; long mark[210000]; long lev[210000]; lon

原创 hdu--1016 素素環(dfs)

#include "stdio.h" #include "string.h" #include "math.h" int visit[22],save[22]; int n,k=1,cur; int Isprime(int x) {

原创 馬踏棋盤方法二--用數組存方向

#include "stdio.h" #include "math.h" #include "string.h" int n,mark[100][100],cur,flag,savex[1000],savey[1000],count; i

原创 pku-1664 放蘋果(遞推)

#include "stdio.h" #include "math.h" int f(int m, int n) { if(m<0) return 0; if(m==0||n==1) return 1; return f(m-n,n