摘要: Starting with x and repeatedly multiplying by x, we can compute x31 with thirty multiplications: The operation of squaring can appreciably shorten the 阅读全文
posted @ 2015-07-31 18:56 江南何采莲 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Description Today on a lecture about strings Gerald learned a new definition of string equivalency. Two strings a and b of equal length are calledequi 阅读全文
posted @ 2015-07-28 21:16 江南何采莲 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 通过暴力或者dfs的方法可以很容易地得到n个数的全排列,可生成可重集的呢,例如给出一个数组a[],要求输出这个数组的全排列,与普通的求全排列不同,数组中很可能存在重复的数,所以方法都需要改一改: DFS #include"iostream" #include"cstring" #include"cs 阅读全文
posted @ 2015-07-27 18:37 江南何采莲 阅读(463) 评论(0) 推荐(0) 编辑
摘要: 枚举,由已知条件推得y大于k,小于等于2K AC代码: #include"iostream"#include"cstring"using namespace std;const int maxn=20002;int a[maxn];int b[maxn];int main(){ int i,y; i 阅读全文
posted @ 2015-07-27 16:34 江南何采莲 阅读(391) 评论(0) 推荐(0) 编辑
摘要: Description A ring is composed of n (even number) circles as shown in diagram. Put natural numbers into each circle separately, and the sum of numbers 阅读全文
posted @ 2015-07-27 14:49 江南何采莲 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Given a sequence of integers S = {S1, S2, ..., Sn}, you shoulddetermine what is the value of the maximum positive product involving consecutive terms 阅读全文
posted @ 2015-07-27 14:43 江南何采莲 阅读(387) 评论(0) 推荐(0) 编辑
摘要: Description Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits 0 through 9 once each, such that the 阅读全文
posted @ 2015-07-27 14:36 江南何采莲 阅读(271) 评论(0) 推荐(0) 编辑
摘要: Description In this problem, you are given an integer number s. You can transform any integer number A to another integer number B by adding x to A. T 阅读全文
posted @ 2015-07-25 17:10 江南何采莲 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Description You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend o 阅读全文
posted @ 2015-07-24 20:16 江南何采莲 阅读(239) 评论(0) 推荐(0) 编辑
摘要: You have just finished a compiler design homework question where you had to find the parse tree of an expression. Unfortunately you left your assignme 阅读全文
posted @ 2015-07-23 22:39 江南何采莲 阅读(328) 评论(0) 推荐(0) 编辑