原创 bfs模板

#include<cstdio> #include<cstring> #include<queue> #include<algorithm> using namespace std; const int maxn=100; boo

原创 hdu 1010 Tempter of the Bone(dfs)

Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submissio

原创 dfs模板

DFS: /* 該DFS 框架以2D 座標範圍爲例,來體現DFS 算法的實現思想。 */ #include<cstdio> #include<cstring> #include<cstdlib> using namespace s

原创 文章標題poj 3278 Catch That Cow(bfs實現)

Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 61611 Accepted: 19259 Descr

原创 小泉的難題

小泉的難題 Time Limit: 1000ms   Memory limit: 65536K  有疑問?點這裏^_^ 題目描述 機械實驗班有個同學叫小泉,有一天數學老師給小泉佈置了一道個人作業,給小泉M(M<=100)組數據,

原创 poj 3522 Slim Span(最小生成樹)kruskal算法

Slim Span Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 7010 Accepted: 3711 Description Giv

原创 CodeForces 550B Preparing Olympiad(dfs暴搜)

B. Preparing Olympiad time limit per test 2 seconds memory limit per test 256 megabytes input standard input

原创 HDU - 1312 Red and Black (dfs)

#include"iostream" #include"cstdio" #include"cstring" using namespace std; const int maxn=20+3; int m,n,visit[maxn][max

原创 hdu 1232 暢通工程(並查集)

暢通工程 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 382

原创 JAVA Calendar詳解

(在文章的最後,將會介紹Date類,如果有興趣,可以直接翻到最後去閱讀) 究竟什麼是一個 Calendar 呢?中文的翻譯就是日曆,那我們立刻可以想到我們生活中有陽(公)歷、陰(農)歷之分。它們的區別在哪呢? 比如有: 月份的定

原创 UVA - 572 Oil Deposits (dfs)

Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvCom

原创 zoj 2833 Friendship(並查集)

Friendship Time Limit: 3 Seconds      Memory Limit: 32768 KB A friend is like a flower, a rose to be exact, Or maybe

原创 素數打表

一種常見的素數打表的方法 void init_prime() { int i, j; for(i = 2;i <= sqrt(1000002.0); ++i) { if(!prime[i]) for(j = i * i;

原创 poj 1182 食物鏈(並查集)

食物鏈 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 54149   Accepted: 15856 Description 動物王國中有三類動物A,B,C,

原创 uva 572 Oil Deposits(bfs實現)

Oil DepositsTime Limit:3000MS    Memory Limit:0KB    64bit IO Format:%lld & %llu SubmitStatusPracticeUVA 572 Descri