原创 紅黑樹詳解

https://www.jianshu.com/p/e136ec79235c 在圖2.1.2.3中如果p爲紅色可以直接變爲黑色即可實現自平衡,如果p爲黑色則將p作爲刪除情形向上處理

原创 openjudge 海賊王之偉大航路 狀態壓縮dp

“我是要成爲海賊王的男人!”,路飛一邊喊着這樣的口號,一邊和他的夥伴們一起踏上了偉大航路的艱險歷程。 路飛他們偉大航路行程的起點是羅格鎮,終點是拉夫德魯(那裏藏匿着“唯一的大祕寶”——ONE PIECE)。而航程中間,則是各式各樣的島嶼

原创 hdu 1042 N!

#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int MAX = 1000

原创 思維+kmp

第八屆福建省大學生程序設計競賽-重現賽(感謝承辦方廈門理工學院) 思維題+kmp 之前一直T 後來想了下 strstr的複雜度是O(n*m) 纔想到kmp 只要Alice的串比Bob長 並且Bob的串是Alice的串或反轉串的子串 贏家就

原创 二維前綴和 codeforces 832C

#include <iostream> #include <cstdio> #include <cstring > #include <iostream> using namespace std; int mp[102

原创 區間dp

The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move pla

原创 codeforces838A Binary Blocks

                                                                                                      

原创 Fibonacci HDU - 1568

2007年到來了。經過2006年一年的修煉,數學神童zouyu終於把0到100000000的Fibonacci數列 (f0=0,f1=1;fi = fi−1+fi−2 (i>=2))的值全部給背了下來。 接下來,Co

原创 中國大學生程序設計競賽 (合肥) 異或密碼

題目傳送門 直接上代碼 題解在代碼裏 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; c

原创 QSC and Master

Every school has some legends, Northeastern University is the same. Enter from the north gate of Northeastern Univers