原创 POJ1573 Robot Motion

Description A robot has been programmed to follow the instructions in its path. Instructions for the next direction the

原创 uva437 巴比倫塔

AC Code#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string> #include <string.h> #include <algor

原创 hdu3615 Cow Hurdles

Description Farmer John wants the cows to prepare for the county jumping competition, so Bessie and the gang are practi

原创 uva10976

AC Code#include<stdio.h> #include<math.h> using namespace std; int main() { int k,x,y; while(scanf(

原创 算法訓練 字串統計 kmp

問題描述  給定一個長度爲n的字符串S,還有一個數字L,統計長度大於等於L的出現次數最多的子串(不同的出現可以相交),如果有多個,輸出最長的,如果仍然有多個,輸出第一次出現最早的。輸入格式  第一行一個數字L。  第二行是字符串S。  L

原创 hdu1800 Flying to the Mars

Description In the year 8888, the Earth is ruled by the PPF Empire . As the population growing , PPF needs to find mor

原创 poj2446 Chessboard

Description Alice and Bob often play games on chessboard. One day, Alice draws a board with size M * N. She wants Bob t

原创 hdu1301 Jungle Roads

Description The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent o

原创 hdu1253 勝利大逃亡

Description Ignatius被魔王抓走了,有一天魔王出差去了,這可是Ignatius逃亡的好機會.魔王住在一個城堡裏,城堡是一個A*B*C的立方體,可以被表示成A個B*C的矩陣,剛開始Ignatius被關在(0,0,0)的位置

原创 poj3461 Oulipo

Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He w

原创 hdu2689 Sort it

Description You want to processe a sequence of n distinct integers by swapping two adjacent sequence elements until the

原创 hdu1398 Square Coins

Description People in Silverland use square coins. Not only they have square shapes but also their values are square nu

原创 hdu1166 敵兵佈陣

Description C國的死對頭A國這段時間正在進行軍事演習,所以C國間諜頭子Derek和他手下Tidy又開始忙乎了。A國在海岸線沿直線佈置了N個工兵營地,Derek和Tidy的任務就是要監視這些工兵營地的活動情況。由於採取了某種先

原创 hdu1556 Color the ball

Description N個氣球排成一排,從左到右依次編號爲1,2,3....N.每次給定2個整數a b(a <= b),lele便爲騎上他的“小飛鴿"牌電動車從氣球a開始到氣球b依次給每個氣球塗一次顏色。但是N次以後lele已經忘記了第

原创 hdu1541 Stars

Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cart