原创 HDU 3336 (KMP上的dp問題,ac自動機我來了)

Count the string Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(

原创 Nim遊戲,異或解決問題,神證明

地址:http://baike.baidu.com/view/1101962.htm?fr=aladdin#4 Nim遊戲編輯 本詞條缺少信息欄、名片圖,補充相關內容使詞條更完整,還能快速升級,趕緊來編輯吧! Nim遊戲

原创 POJ 3461 Oulipo (KMP,求模版串在文本串中可覆蓋出現的次數,constructive)

Oulipo Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 24213   Accepted: 9711 Description The French

原创 Codeforces 472D. Design Tutorial: Inverse the Problem(一種逆向判定樹成立的辦法,從Kruskal到dfs)

D. Design Tutorial: Inverse the Problem time limit per test 2 seconds memory limit per test 256 megabytes input

原创 Codeforces 464B. Restore Cube (一種高效八點判斷立方體(cube)的辦法)

B. Restore Cube time limit per test 1 second memory limit per test 256 megabytes input standard input output

原创 Topcoder SRM 144 Div1 550(數學和dp問題求方案數,很有意思)

Problem Statement   In most states, gamblers can choose from a wide variety of different lottery games. The rules

原创 CDOJ 843 冰雪奇緣 (線段樹+懶操作+離散化)

冰雪奇緣 Time Limit: 30000/10000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Submit  Status 艾莎女王

原创 Codeforces 472B. Design Tutorial: Learn from Life(坐電梯扯淡題)

B. Design Tutorial: Learn from Life time limit per test 1 second memory limit per test 256 megabytes input sta

原创 Codeforces 263 C. Circle of Numbers D. Cycle in Graph (dfs一般難度)

C. Circle of Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input o

原创 Codeforces 464A. No to Palindromes! (dp,向前推理,向後查詢)

A. No to Palindromes! time limit per test 1 second memory limit per test 256 megabytes input standard input o

原创 Codeforces 463D. Gargari and Permutations (dp,distinct下的LCS問題)

D. Gargari and Permutations time limit per test 2 seconds memory limit per test 256 megabytes input standard in

原创 UVA11019 Matrix Matcher(一種計算子矩陣在母矩陣中出現次數的辦法,AC自動機+kmp)

Problem H Matrix Matcher Input: Standard Input Output: Standard Output   Given an N * M matrix, your task is to find

原创 Topcoder SRM 635 Div2 1000 (一種 O(n) 求一棵樹中最長連續邊 長度的方法)

Problem Statement   There is a weighted tree with N vertices. The vertices are numbered 0 through N-1. You're g

原创 CDOJ 251 導彈攔截 (LIS,一種找到字典序最小的最長上升子序列的方法)

導彈攔截 Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Submit  Status 某國爲了防

原创 Topcoder SRM 146 Div2 1000(dfs搜索,經典過橋問題,很有意思)

Problem Statement   A well-known riddle goes like this: Four people are crossing an old bridge. The bridge cannot