原创 hdoj 2067 小兔的棋盤【水】【dp】

#include <stdio.h> #include <string.h> #define MAX 40 int main() { long long flag[MAX][MAX]; for(int i=0; i<=35; i++)

原创 hdoj 1443 Joseph【水】

#include <stdio.h> int main() { int n; int flag[14] = {0, 2,7,5,30,169,441,1872,7632,1740,93313,459901,1358657,2504

原创 zoj 2109 FatMouse' Trade【水】

wa了好幾次,網上查了一下說是不能對float sort排序... #include <stdio.h> #include <algorithm> using namespace std; struct room {

原创 黑書 P42 1.3.8 World Final 2002 - G Partition

從網上下的課後習題解答說用floodfill做,但是根本沒有思路,根本不知道怎麼去floodfill。 後來想主要一點就是去掉其中的多餘的線段,用遞歸把圖形處理成符合要求的,然後求上確界和下確界就很簡單了。 處理的過程有很多很多判斷,噁心

原创 hdoj 1286 找新朋友【水】

#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stack> using namespace std; bool flag[32768],staue[

原创 hdoj 1717 小數化分數2【水】

/* 循環小數化分數: 小數形式:循環部分&循環部分 【&】表示連接 分數形式: (非循環部分&循環部分)/( (10^(循環節位數)-1)^(非循環節位數) ) 例: 0.32(692307) 32692307 / 99999900

原创 hdoj 1250 Hat's Fibonacci【java】【水】

import java.util.Scanner; import java.math.BigInteger; import java.math.BigDecimal; public class Main { public static

原创 hdoj 1134 Game of Connections【水】【java】

import java.util.Scanner; import java.math.BigInteger; import java.math.BigDecimal; public class Main { public static

原创 hdoj 2050 折線分割平面【DP】【水】

使折線的夾角儘可能小,這樣可以看成一條射線,則最大的情況便是所有射線不平行,對於第n條折線,其一條邊與前n-1 條邊相交可以增加2*(n-1)個區域,這條折線的頭部又成一塊,所以是2*(n-1)+1+f(n-1) #include <st

原创 HDOJ 2087 剪花布條【KMP】

#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 1001 int next[MAX]; char s[MAX], q[MAX]; void ge

原创 hdoj 1997 漢諾塔VII【水】

#include <stdio.h> #include <string.h> /* hanio函數:表示當前的任務是將大小爲floor的盤子從from移動到to,當然這個盤子如果在mid(另外一個柱子)上時就證明這不是最優序列,  

原创 HDOJ 2037 今年暑假不AC 【暴力解決】⊙﹏⊙b汗

#include <stdio.h> #include <algorithm> using namespace std; #define PLINE printf("\n------------------\n") struct time

原创 zoj 2876 Phone List【字典樹】【水】

如果一個號碼就是另外一個號碼的前綴就輸出NO 注意應該將號碼按照長度升序排序。 寫的很亂,本來這個代碼就不是爲了這道題寫的。 我只是測試一下這種建樹的方式對不對 #include <stdio.h> #include <string.h

原创 zoj 1109 Language of FatMouse 【字典樹】

#include <stdio.h> #include <stdlib.h> #include <string.h> struct __TrieNode { char value; char * word; struct __Tri

原创 zoj 2659 Box【水】

#include <stdio.h> #include <iostream> #include <algorithm> using namespace std; #define PLINE printf("-------------\n"