原创 Longest Prefix

題目見:http://wenku.baidu.com/view/816dfaf29e31433239689324.html #include<fstream> #include<string> using namespa

原创 Cow Pedigrees

//題目見:http://wenku.baidu.com/view/816dfaf29e31433239689324.html //每個樹的狀態都由其左右子樹狀態決定,根據乘法原理,其狀態數等於左右子樹狀態數乘積 #include<fst

原创 Healthy Holsteins

#include<fstream> using namespace std; int n;//保存維生素的種類數,n<30 int v[30];//每天需要的每種維生素數 int m;//保存飼料種類數,m<20 int s[20][30

原创 The Tamworth Two

題目網址:http://wenku.baidu.com/view/816dfaf29e31433239689324.html #include<fstream> #include<iostream> using namespace std

原创 Feed Ratios

#include<fstream> #include<iostream> using namespace std; ifstream fin ("ratios.in"); ofstream fout ("ratios.out"); int

原创 spin

#include<iostream> #include<fstream> using namespace std; int main() { ifstream fin ("spin.in"); ofstream fout ("spin

原创 並差集

Description Do you know a software called "WeiXin", a kind of chatting tool? There is an application called "Shaking

原创 字符串反轉

#include<iostream> #include<malloc.h> #include<string.h> using namespace std; int convert(string s) { char c[10][20];

原创 Agri-Net

#include<fstream> #include<iostream> using namespace std; ifstream fin ("agrinet.in"); ofstream fout ("agrinet.out"); i

原创 contact+枚舉方法

#include<iostream> #include<fstream> #include<cstring> #include<string> using namespace std; #define M 12 #define N 409

原创 stamps+動態規劃

#include<iostream> #include<fstream> #include<cmath> using namespace std; int main() { ifstream fin ("stamps.in"); of

原创 msquare 有點超時

#include<iostream> #include<fstream> #include<string> using namespace std; #define null NULL; typedef struct node { s

原创 poj 1068

#include<fstream> #include<iostream> #include<stack> #include<vector> #include<string> using namespace std; void run(in

原创 flody

參考文獻 #include<iostream> using namespace std; int MAX_DIS=999; int graph[50][50]; int dis[50][50]; int path[50][50]; in

原创 圖的廣度搜索完整實現(鄰接表,隊列,BFS)

//構造鄰接表,隊列,廣度優先搜索 #include<iostream> #include<malloc.h> #define null NULL using namespace std; typedef struct nd { int