原创 裝載問題

        輸入樣例 輸出樣例 80 4 18 7 25 36 79 完整程序: #include<bits/stdc++.h> using namespace std; //裝載問題分支限界算法 //(1)裝

原创 n皇后問題

 完整程序: #include<bits/stdc++.h> using namespace std; //n皇后問題回溯算法的實現 //(1) n皇后問題回溯算法的數據結構 #define NUM 20 int n; //

原创 圖的m着色問題

    完整程序: #include<bits/stdc++.h> using namespace std; //圖的m着色問題回溯算法 //(1) 圖的m着色問題回溯算法的數據結構 #define NUM 100 int n;

原创 ZOJ1161-Gone Fishing

  1   2        //n 1        //h 10 1   //fi 2 5     //di 2        //ti 4 4 10 15 20 17 0 3 4 3 1 2 3 4 4 10 15 50

原创 ZOJ1025-Wooden Sticks

  完整程序: #include<bits/stdc++.h> using namespace std; //ZOJ1025-Wooden Sticks貪心算法 #define maxN 5001 struct stick

原创 最長單調遞增子序列

  下標 1 2 3 4 5 6 7 8 數組a 65 158 170 155 239 300 207 389 數組b 1 2 3 2

原创 半數集問題

#include<iostream> #include<algorithm> #include <stdio.h> using namespace std; //半數集問題 int comp(int n) { int ans=1;

原创 struts2整合spring報404

1、首先檢查配置文件,一定要仔細地檢查每個字母。 2、檢查jar包是否有遺漏的,我把我整理的在整合中需要的jar上傳了,有需要的可以直接下載。 鏈接:https://pan.baidu.com/s/12Cf3dZFk_5RU812EwLT

原创 集合的劃分

問題描述: 設S是一個具有n個元素的集合,S={a1,a2,...,an},現將S劃分成k個滿足下列條件的子集S1,S2,...,Sk,且滿足: Si≠空集 Si∩Sj=空集(1<=i,j<=k i≠j) S1∪S2∪...∪Sk=S 則

原创 象棋最少步數問題

問題描述: 在各種棋中,棋子的走法總是一定的,如中國象棋中馬走“日”。有一位小學生就想如果馬能有兩種走法將增加其趣味性,因此,他規定馬既能按“日”走,也能如象一樣走“田”字。他的同桌平時喜歡下圍棋,直到這件事後覺得很有趣,就想試一試,在一

原创 ZOJ1002-Fire Net

行 / 列 0 1 2 3 0 0 1 2 3 1 4 5 6 7 2 8 9 10 11 3 12 13 14 15  完整程序:

原创 旅行商問題(TSP問題)

輸入樣例 輸出樣例 4 6 1 2 20 1 4 4 1 3 6 2 3 5 2 4 10 3 4 15 0 1 3 2 4 25     完整程序: #include<bits/stdc++.h> usin

原创 整數因子分解

  #include<bits/stdc++.h> using namespace std; //整數因子分解 int total; //定義爲全局變量 void solve(int n) { if (n==1) total+

原创 0-1揹包問題

輸入樣例 輸出樣例 50 3 10 60 30 120 20 100 0 220     完整程序: #include<bits/stdc++.h> using namespace std; // 0-1揹包問題回

原创 ZOJ1108-FatMouse's Speed

       完整程序: #include <bits/stdc++.h> using namespace std; //ZOJ1108-FatMouse's Speed動態規劃 struct mouse { int weight