原创 Sicily 2011 Nine Digits

Constraints Time Limit: 2 secs, Memory Limit: 256 MB Description  Nine tiles, each with a number from 1 to 9 on it, ar

原创 Sicily 1022 Poor contestant Prob

Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description As everybody known, “BG meeting” is very very popula

原创 Sicily 1282 Computer Game

Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Brian is an enthusiast of computer games, especially

原创 康託展開和逆康託展開

康託展開   康託展開的公式是 X=an*(n-1)!+an-1*(n-2)!+...+ai*(i-1)!+...+a2*1!+a1*0! 其中,ai爲當前未出現的元素中是排在第幾個(從0開始)。   這個公式可能看着讓人頭大,最好舉個例

原创 Sicily 1210 二叉樹

Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description 在衆多的數據結構中,二叉樹是一種特殊而重要的結構,有着廣泛的應用。二叉樹或者是一個結點,或者有且僅有一個結

原创 Sicily 1750 運動會

Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description ZEH是一名04級的學生,他除了績點高,還有運動細胞。有一次學院舉辦運動會,ZEH發現裏面的項目都是他所

原创 Sicily 1305 Who’s Winner?

Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Nic and Susan play the game of multiplication by mul

原创 Sicily 1935 二叉樹重建

數據結構的簡單題,對幫助理解二叉樹的遍歷蠻有幫助的。 #include <iostream> #include <cstring> using namespace std; struct node { char val; nod

原创 我對於KMP算法的一點理解

KMP算法是很巧妙的,代碼又短,它涉及到了我所學到的狀態轉移的東西,我用這個來理解KMP,效果是比較好的。 首先說一下狀態轉移,用我的話來說就是轉跳,從一個值轉跳到另一個值,比如說匹配了3個字符,然後轉跳到了匹配了1個字符(注意,這個就是

原创 Sicily 1166 Computer Transformat

Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description A sequence consisting of one digit, the number 1 is

原创 Sicily 1176 Two Ends

Constraints Time Limit: 1 secs, Memory Limit: 64 MB Description In the two-player game "Two Ends", an even number of

原创 Sicily 2010 H Number

大意是要找出符合規律的數字,數據量不大,窮舉即可。 #include<stdio.h> #include<math.h> bool hNumber(int n); int main() { int i,n,count=0;

原创 Sicily 1209 Sequence Sum Possibi

Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Most positive integers may be written as a sum of a s

原创 Sicily 1193 Up the Stairs

Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description John is moving to the penthouse of a tall sky-scrape

原创 Sicily 1031 Campus

大意就是求出兩個地點的最短路。 簡單的單源最短路問題,我用的是優先隊列實現的dijkstra算法,離散數學教的~注意題目的陷阱,輸入數據的坑就好啦。 #include <iostream> #include <map> #include