原创 排序(1106)
*輸入一行數字,如果我們把這行數字中的‘5’都看成空格,那麼就得到一行用空格分割的若干非負整數(可能有些整數以‘0’開頭,這些頭部的‘0’應該被忽略掉,除非這個整數就是由若干個‘0’組成的,這時這個整數就是0)。 你的任務是:對這些分割
原创 Children's Day(4706)
Today is Children's Day. Some children ask you to output a big letter 'N'. 'N' is constituted by two vertical linesan
原创 What Is Your Grade?(1084)
“Point, point, life of student!” This is a ballad(歌謠)well known in colleges, and you must care about your score in t
原创 Souvenir(5310)
*Today is the 1st anniversary of BestCoder. Soda, the contest manager, wants to buy a souvenir for each contestant. Yo
原创 循環多少次?(1799)
我們知道,在編程中,我們時常需要考慮到時間複雜度,特別是對於循環的部分。例如, 如果代碼中出現 for(i=1;i<=n;i++) OP ; 那麼做了n次OP運算,如果代碼中出現 fori=1;i<=n; i++) fo
原创 大明A+B(1753)
話說,經過了漫長的一個多月,小明已經成長了許多,所以他改了一個名字叫“大明”。 這時他已經不是那個只會做100以內加法的那個“小明”了,現在他甚至會任意長度的正小數的加法。 現在,給你兩個正的小數A和B,你的任務是代表大明計算出A
原创 初學數據結構之二叉樹
一:二叉樹的鏈表實現 typedef struct TreeNode *BinTree; typedef BinTree Position; struct TreeNode { int Data; BinTree Left; Bin
原创 初學數據結構之隊列
一.數組實現(只用N-1個空間) #define MaxSize 10 typedef struct { int Data[MaxSize]; int rear; int front; }Quene; void AddQ(Qu
原创 deque
<a href="http://blog.csdn.net/longshengguoji/article/details/8519812" target=_blank>deque</a> deque容器爲一個給定類型的元素進行線性
原创 鄭廠長系列故事——體檢(4519)
鄭廠長不是正廠長 也不是副廠長 他根本就不是廠長 只是公司的一個碼農 鄭廠長所在的騰訊公司每一年都要組織員工體檢,比如量身高體重、測血壓之類的,今年也不例外。 這次總共有N位員工接受體檢,並且每個員工都需要做K
原创 Senior's Array(5280)
*One day, Xuejiejie gets an array A. Among all non-empty intervals of A, she wants to find the most beautiful one. S
原创 00-自測5. Shuffling Machine (20)
Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as
原创 set
<a href="http://blog.csdn.net/lansetiankong_yiyi/article/details/5816362" target=_blank>set</a> set/multiset會根據待定的
原创 Hidden String(5311)
*Today is the 1st anniversary of BestCoder. Soda, the contest manager, gets a string s of length n. He wants to find
原创 Web Navigation(1028)
Standard web browsers contain features to move backward and forward among the pages recently visited. One way to imp