原创 HDU1041 Computer Transformation(java)

Problem Description A sequence consisting of one digit, the number 1 is initially written into a computer. At each

原创 HDU1026 Ignatius and the Princess I(java)

Problem Description The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our

原创 HDU1038 Biker's Trip Odometer(java)

Problem Description Most bicycle speedometers work by using a Hall Effect sensor fastened to the front fork of the

原创 HUD1022 Train Problem I

題意 給出兩個字符串序列,長度都爲n,求解能否利用棧把第一個序列轉換成第二個序列。 解答 import java.util.Arrays; import java.util.Scanner; import java.util

原创 HDU1039 Easier Done Than Said?(java)

Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy to remember (

原创 HDU1030 Delta-wave(java)

Problem Description A triangle field is numbered with successive integers in the way shown on the picture below.

原创 HDU1035 Robot Motion(java)

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

原创 HDU1033 Eage(java)

題目太長… http://acm.hdu.edu.cn/showproblem.php?pid=1033 題意是:A爲右轉,V爲左轉,初始座標是300,420,每次走10,模擬四個走向就可以了, import java.uti

原创 康託展開

康託展開 公式爲X = an*(n-1)!+an-1*(n-2)!+…+ai*(i-1)!+…+a2*1!+a1*0! 其中,ai爲在當前未出現的元素中升序排第幾個(從0開始)。 例如,有一個數組 s = [“A”, “B”,

原创 揹包九講(轉載)

P01: 01揹包問題 題目 有N件物品和一個容量爲V的揹包。第i件物品的費用是c[i],價值是w[i]。求解將哪些物品裝入揹包可使這些物品的費用總和不超過揹包容量,且價值總和最大。 基本思路 這是最基礎的揹包問題,特

原创 HDU1034 Candy Sharing Game(java)

Problem Description A number of students sit in a circle facing their teacher in the center. Each student initiall

原创 HDU1031 Design T-Shirt(java)

Problem Description Soon after he decided to design a T-shirt for our Algorithm Board on Free-City BBS, XKA found

原创 HDU1026 Ignatius and the Princess IV(java)

Problem Description “OK, you are not too bad, em… But you can never pass the next test.” feng5166 says. “I will te

原创 HDU1028 Ignatius and the Princess III(java)

Problem Description “Well, it seems the first problem is too easy. I will let you know how foolish you are later.”

原创 HDU1036 Average is not Fast Enough!(java)

Problem Description A relay is a race for two or more teams of runners. Each member of a team runs one section of