原创 概率論模擬

某遊戲規則中,甲乙雙方每個回合的戰鬥總是有一方勝利,一方失敗。遊戲規定:失敗的一方要把自己的體力值的1/4加給勝利的一方。例如:如果雙方體力值當前都是4,則經過一輪戰鬥後,雙方的體力值會變爲:5,3。 現在已知:雙方開始時的體力值甲:10

原创 精簡八皇后問題

問題描述    會下國際象棋的人都很清楚:皇后可以在橫、豎、斜線上不限步數地喫掉其他棋子。如何將8個皇后放在棋盤上(有8 *    8個方格),使它

原创 Effective C++ (reading note)

Item 12: 最重要的問題是避免死鎖,活鎖(livelock)和惡性的競爭條件(包括加鎖不足導致的崩潰)。 Item 20: 窺視C++編譯器

原创 kmp算法簡述

主串  (S 串 )   模式串(  T  串)   next  :   next[j]=0 (  當  j=1  時  )    next[j]=Max (  當  1<k<j  且  p1......pk-1=pj-(k-

原创 To the Max

To the Max Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 28700   Accepted: 14919 Description Given a t

原创 const type&的使用注意

一、const 和引用聯合使用的時候要注意 const int a = 1; const int& ref1 = a; const int& ref2 = 1; ref1 和 ref2 都是正確的,但是他們引用的內容和一般的引用不同

原创 T9

T9 Time  Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K  (Java/Others) Total Submission(s): 757    Ac

原创 Silver Cow Party

Silver Cow Party Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7579   Accepted: 3354 Description One

原创 Number Sequence

Number Sequence Time  Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K  (Java/Others) Total Submission(

原创 Ignatius and the Princess I

Ignatius and the Princess I Time  Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K  (Java/Others) Total

原创 Maximum sum on a torus

Maximum sum on a torusInput: Standard Input Output: Standard Output A grid that wraps both horizontally and vertically

原创 C++頭文件

傳統 C++   #include <assert.h> //設定插入點   #include <ctype.h> //字符處理   #include <errno.h> //定義錯誤碼   #include <float.h

原创 Extra Krunch

Extra Krunch Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 4794   Accepted: 1180 Description A krunche

原创 Constructing Roads In JGShining's Kingdom

Constructing Roads In JGShining's Kingdom Time  Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K  (Java

原创 Gone Fishing

Gone Fishing Time Limit: 2000MS   Memory Limit: 32768K Total Submissions: 21189   Accepted: 6030 Description John is