Edit Distance時間限制: 1秒 記憶體限制: 64MProblem DescriptionGiven a string, an edit script is a set of instructions to turn itinto another string. There arethree kinds of operations in an edit script:Add: Output one character. This instruction does not
Knight Moves時間限制: 1秒 記憶體限制: 64MDescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given set of n squares on a chessboard
Leftmost Digit時間限制: 1秒 記憶體限制: 1024KBDescriptionGiven a positive integer n, please write a program to get the leftmost digit of n!. (1 <= n<= 10^7).InputThe input contains several test cases, the first line of the input is an integer t (t<=
Exchange for Cola時間限制: 1秒 記憶體限制: 64MProblem DescriptionThe Cola company is holding a promotional activity that customerscan exchange B bottles of Cola with A caps. Now Silence has N caps. Furthermore, Silence can ask mm to borrow him some caps for
從來沒寫過blog,這篇就當開始吧,就隨手找個簡單的題目來練練手。題目地址:http://acm.bit.edu.cn/mod/programming/view.php?a=487Average Numbers時間限制: 1秒 記憶體限制: 64MProblem DescriptionYou are given a sequence of positive integers a1, a2, ..., an. Find all such indices i, that the i-th
Roman numerals時間限制: 1秒 記憶體限制: 64MProblem DescriptionNow let’s think about roman numerals!-The Roman numerals for 1 through 10 are I, II, III, IV, V, VI, VII, VIII, IX, and X.-The Roman numerals for 20, 30, 40, and 50 are XX, XXX, XL, and L.-The
Relatives時間限制: 1秒 記憶體限制: 64MProblemDescriptionGiven n, a positive integer, how many positive integers less than or equal to n are relatively prime to n ? Two integers a and b are relatively prime if thereare no integers x > 1, y > 0, z > 0