原创 整數劃分(遞歸)全部排列 (較簡潔代碼+詳細註釋)

首先介紹一下思路 n表示被劃分的數 m表示劃分中的最大值 //   根據n和m的關係,考慮以下幾種情況: //   (1)當 n = 1 時,不論

原创 sicily 1198. Substring

1198. Substring Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Dr lee cuts a string S into N piece

原创 sicily 1046. Plane Spotting

1046. Plane Spotting Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Craig is fond of planes. Maki

原创 sicily 1051. Biker's Trip Odomete

1051. Biker's Trip Odomete Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Most bicycle speedometer

原创 迷宮深度優先搜索 找出一條可行路徑

 請寫一個程序,先輸入迷宮的維度M和N,然後輸入這個M * N的迷宮,迷宮位置上的數值爲0代表該位置可以通過,爲1代表該位置有障礙不能通過,用深度優先搜索算法搜出一條從迷宮左上角到右下角的路徑。規定搜索順序爲上、下、左、右。 如: 迷宮

原创 冪集問題

我們先看百度百科對冪集的定義: 所謂冪集(Power Set), 就是原集合中所有的子集(包括全集和空集)構成的集族。 我們這個題的任務就是將一個集

原创 sicily 1176. Two Ends

1176. Two Ends Constraints Time Limit: 1 secs, Memory Limit: 64 MB Description In the two-player game "Two Ends", a

原创 sicily 1035. DNA matching

1035. DNA matching Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description DNA (Deoxyribonucleic acid) is f

原创 sicily 1151 魔板

1151. 魔板 Constraints Time Limit: 1 secs, Memory Limit: 32 MB , Special Judge Description 題目和A題相同,在這裏我們把數據範圍擴大:N可能超過

原创 sicily 1027. MJ, Nowhere to Hide

1027. MJ, Nowhere to Hide Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description On BBS, there is a famil

原创 sicily 1021 couples

1021. Couples Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description N couples are standing in a circle,

原创 函數值傳遞,指針傳遞與引用傳遞的區別 及解釋。

#include<iostream> #include <ctime> using namespace std; /*第一部分   基礎*/ //值 /*void mySwap(int a, int b) {     int temp

原创 sicily 1381. a*b

1381. a*b Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Give two positive integers a and b, pleas

原创 sicily 1206. Stacking Cylinders

1206. Stacking Cylinders Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Problem Cylinders (e.g. oi

原创 人工智能-八皇后爬山法(最陡上升,首項選擇),隨即重新啓動法

#include<iostream> #include<string> #include<time h=""> #include<iomanip> using namespace std; int qi[64]; int maze[64