原创 ZOJ 1011 NTA (DFS)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1011 簡單題,DFS #include <iostream> #include <string.h> #inc

原创 (未完)大端模式 vs. 小端模式

1 . 小端和大端的定義 我們知道,字節是計算機上最小的存儲器尋址單位,而不是位。在幾乎所有的機器上,多字節對象都被存儲爲連續的字節序列,對象的地址爲所使用字節中最小的地址。比如有int型變量x,x的地址&x = 0x00,那麼x的4個

原创 ZOJ 1027 Human Gene Functions (DP)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1027 題目意思: 計算兩個核苷酸序列的相似性。可以通過插入'-'符號,將兩個核苷酸對應,每對核苷酸都有相應的分數

原创 ZOJ 1091 Knight Moves (BFS)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=91 馬走日,注意重複走的問題 #include <iostream> #include <queue> #inclu

原创 ZOJ 1204 Additive equations (回溯)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=204 非遞歸版本,回贖+剪枝 #include <iostream> #include <vector> #incl

原创 ZOJ 1406 Jungle Roads (最小生成樹)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=406 最小生成成樹之Prim算法 #include <iostream> #include <vector> #in

原创 ZOJ 1024 Calendar Game (DP)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1024 #include <stdio.h> #include <string.h> int days[] =

原创 ZOJ 1101 Gamblers (簡單搜索)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=101 題目意思:求滿足a=b+c+d的最大a。 下面給出的解法時間複雜度爲n^3log(n),即先排序,查找d=a-b

原创 ZOJ 1095 Humble Numbers (構造)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1095 題目意思:某數的質因數分解中只含有2,3,5或7,則稱該數爲醜數。已知前20個醜數爲1, 2, 3, 4,

原创 ZOJ 1602 Multiplication Puzzle (DP)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1602 用D[i][j]表示從i到j的最小值,假設t爲最後一個乘積點,則D[i][j] = min{D[i][t]

原创 ZOJ 1084 Channel Allocation (回溯)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1084 要解決此問題,可以先解決該問題的子問題:如何用N種顏色將Graph區分開(着色問題)。 #include

原创 ZOJ 1047 Image Perimeters (BFS)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=10471.BFS求出所有在同一個object中的X 2.計算周長時分析X的每一條邊,例如是否是邊界、是否和旁邊某一

原创 STL之轉載

分享:淺談C++容器(轉) 百度空間_應用平臺 標準C++中的STL容器類簡介 點贊 收藏 分享 文章舉報 fangjiaguo 發佈了39 篇原創文章 · 獲贊 1 · 訪問

原创 ZOJ 1081 Points Within (幾何)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1081 有一些經常用的幾何知識,留着備用! #include"iostream" #include"string

原创 ZOJ 1005 Jugs (DFS)

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1005 #include <stdio.h> #include <string.h> #include <vec