原创 Educational Codeforces Round 20-C. Maximal GCD

原題鏈接 C. Maximal GCD time limit per test 1 second memory limit per test 256 megabytes input standard input out

原创 Codeforces457-D. CGCDSSQ

原題鏈接 D. CGCDSSQ time limit per test 2 seconds memory limit per test 256 megabytes input standard input o

原创 Codeforces Round #408 (Div. 2)-D. Police Stations

原題鏈接 D. Police Stations time limit per test 2 seconds memory limit per test 256 megabytes input standard input

原创 Codeforces Round #161 (Div. 2)-D. Cycle in Graph

原題鏈接 D. Cycle in Graph time limit per test 2 seconds memory limit per test 256 megabytes input standard in

原创 Codeforces768C-Jon Snow and his Favourite Number

原題鏈接 C. Jon Snow and his Favourite Number time limit per test 4 seconds memory limit per test 256 megabytes

原创 Codeforces Round #221 (Div. 2)-D. Maximum Submatrix 2

原題鏈接 D. Maximum Submatrix 2 time limit per test 2 seconds memory limit per test 512 megabytes input stand

原创 Educational Codeforces Round 19-E. Array Queries

原題鏈接 E. Array Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard inp

原创 Codeforces Round #223 (Div. 2)-C. Sereja and Prefixes

原題鏈接 C. Sereja and Prefixes time limit per test 1 second memory limit per test 256 megabytes input standard inp

原创 Codeforces Round #277.5 (Div. 2)-F. Special Matrices

原題鏈接 F. Special Matrices time limit per test 1 second memory limit per test 256 megabytes input standard input

原创 Codeforces Round #416 (Div. 2)-C. Vladik and Memorable Trip

原題鏈接 C. Vladik and Memorable Trip time limit per test 2 seconds memory limit per test 256 megabytes input stand

原创 Educational Codeforces Round 16-C. Magic Odd Square

原題鏈接 C. Magic Odd Square time limit per test 1 second memory limit per test 256 megabytes input standard i

原创 Educational Codeforces Round 19-D. Broken BST

原題鏈接 D. Broken BST time limit per test 1 second memory limit per test 256 megabytes input standard input outp

原创 幻方構造

幻方分爲3類。奇階幻方(奇數)、雙偶幻方(能夠被4整除,如8,12,16……)、單偶幻方(4m+2形式,如6,10……),構造算法各不相同。 下面的程序中,奇階幻方的構造算法爲Merzirac法。雙偶幻方的構造算法爲Spring法。單

原创 C++bind

C++11中提供了std::bind。bind()函數的意義就像它的函數名一樣,是用來綁定函數調用的某些參數的。 bind的思想實際上是一種延遲計算的思想,將可調用對象保存起來,然後在需要的時候再調用。而且這種綁定是非常靈活的,不論是

原创 C++11中萬能的可調用類型聲明std::function

在C++11中,callable object 包括傳統C函數,C++成員函數,函數對象(實現了()運算符的類的實例),lambda表達式(特殊函數對象)共4種。程序設計,特別是程序庫設計時,經常需要涉及到回調,如果針對每種不同的cal