原创 poj-1740 A New Stone Game 博弈論

題目來源:http://poj.org/problem?id=1740 剛剛看完博弈論的幾篇文章,找了這水題,根據論文裏面的思路很清楚了 #include <iostream> //只需要判斷它是不是有N對相等的情況 #include

原创 poj-2479 簡單DP

題目來源:http://poj.org/problem?id=2479 題目大意就是求一個數組裏面的兩端連續值得最大和 DP從前往後掃一遍 再從後往前掃一遍 然後求1~i 和i+1~n的和的最大值 注意題目要求必須得最低取兩個數 #inc

原创 poj-2601Simple calculations

題目來源:http://poj.org/problem?id=2601 給你公式ai = (ai-1 + ai+1)/2 - ci 給你a0 、 an+1 和 c1~ cn 要求 a1 易推2an=a(n-1) +a(n+1) -2cn

原创 C語言中scanf()的用法!

好文章轉自:http://blog.tianya.cn/blogger/post_show.asp?BlogID=287129&PostID=3668453 scanf詳解   scanf 原型:     # include    int

原创 poj-3045 Cow Acrobats

題目鏈接:http://poj.org/problem?id=3045 按weight+strength 排序就行了 #include <iostream> #include <cstdio> #include <algorithm> u

原创 poj-2406 Power Strings睡前一水~

http://poj.org/problem?id=2406 睡前一水~ 一看就覺得是KMP的next數組... 然後果然是 #include <cstdio> #include <cstring> #include <iostream

原创 poj-2484 A Funny Game

http://poj.org/problem?id=2484 睡前也沒想這麼水的~  但是運氣就這樣  哈哈 博弈論真是說不清楚呀~ #include <iostream> #include <cstdio> using namespac

原创 poj-2100 Graveyard Design

題目來源:http://poj.org/problem?id=2100 睡前一水  直接暴力 一頓亂搞 #include <iostream> #include <cstdio> #include <cmath> using namesp

原创 poj-1012 Joseph

http://poj.org/problem?id=1012 記得這事剛學數據結構鏈表的經典題目 水過題數吧~ #include<iostream> #include <cstdio> using namespace std; int J

原创 poj-1338Ugly Numbers

http://poj.org/problem?id=1338 DP 一步一步累乘上去  用三個標記比較大小就行 #include<iostream> #include<fstream> using namespace std; long

原创 poj-1700 Crossing River

http://poj.org/problem?id=1700 此題講的是N個人過河,每個人都有自己的過河時間,一條船隻能承受2個人,所用時間爲其中過河時間最多的,所以呢,想到有兩種情況,第一種:過河時間最少的人來回接送其他人,第二種:過河

原创 Game theory初步

http://www.cnblogs.com/Knuth/archive/2009/09/05/1561002.html 遊戲1 l    有兩個遊戲者:A和B。 l    有21顆石子。 l    兩人輪流取走石子,每次可取1、2或3顆

原创 尋找必敗態——一類博弈問題的快速解法

轉自:http://www.cnblogs.com/Knuth/archive/2009/09/05/1561005.html     博弈是信息學和數學試題中常會出現的一種類型,算法靈活多變是其最大特點,而其中有一類試題更是完全無法用

原创 poj-1200 Crazy Search

題目來源:http://poj.org/problem?id=1200 遍歷一遍  主要是判重  用到hash 不是很難  水~ #include <iostream> #include <stdio.h> #include <cstr

原创 poj-3051 Satellite Photographs

題目來源:http://poj.org/problem?id=3051 直接廣度搜索 水~ 練手 #include <iostream> #include <string> #include <cstdio> using namespac