原创 How many

題目描述: Give you n ( n < 10000) necklaces ,the length of necklace will not large than 100,tell me How many kinds of n

原创 High bridge, low bridge

題目描述: 最近下了很大的雨,小P都不能開心的出去玩耍了。所以無聊的小P找事來了。 在這些天總共下了很多次雨,每次下雨後,河的水位都會上升一些,然後雨過後水位又會下降到一定位置。在這個河上有許多橋,小P想知道在這些雨過後,有多少橋

原创 Theme Section

題目描述: It’s time for music! A lot of popular musicians are invited to join us in the music festival. Each of them wi

原创 String Problem kmp+最大最小表示法

題目描述: Give you a string with length N, you can generate N strings by left shifts. For example let consider the stri

原创 剪花布條

題目描述: 一塊花布條,裏面有些圖案,另有一塊直接可用的小飾條,裏面也有一些圖案。對於給定的花布條和小飾條,計算一下能從花布條中儘可能剪出幾塊小飾條來呢? 輸入: 輸入中含有一些數據,分別是成對出現的花布條和小飾條,其布條都是用可

原创 迷宮城堡

題目描述: 爲了訓練小希的方向感,Gardon建立了一座大城堡,裏面有N個房間(N<=10000)和M條通道(M<=100000),每個通道都是單向的,就是說若稱某通道連通了A房間和B房間,只說明可以通過這個通道由A房間到達B房間

原创 Network

題目描述: A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several pla

原创 Summer Holiday

題目描述: To see a World in a Grain of Sand And a Heaven in a Wild Flower, Hold Infinity in the palm of your hand And E

原创 Seek the Name, Seek the Fame

題目描述: The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat

原创 Popular Cows

題目描述: DescriptionEvery cow’s dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000

原创 Power Strings

題目描述: Given two strings a and b we define ab to be their concatenation. For example, if a = “abc” and b = “def” the

原创 Tarjan算法詳細講解

原文鏈接:http://www.cnblogs.com/uncle-lu/p/5876729.html Tarjan算法講解的博客網上找到三篇比較好的,現在都轉載了,個人只研究了第一篇,

原创 Count the string

題目描述: It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a st

原创 Substrings

題目描述: You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such th

原创 Cyclic Nacklace

題目描述: CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without