摘要: 一、题目描述There is a permutation P with n integers from 1 to n. You have to calculate its inversion number, which is the number of pairs of Pi an... 阅读全文
posted @ 2016-06-16 17:03 chenximcm 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述A thief has robbed a bank in city 1 and he wants to go to city N. The police know that the thief will choose the shortest path to get t... 阅读全文
posted @ 2016-06-16 13:23 chenximcm 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述Let us define a regular brackets sequence in the following way:Empty sequence is a regular sequence.If S is a regular sequence, then (S... 阅读全文
posted @ 2016-06-16 10:02 chenximcm 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述Given a sequence A = , let sequence B = be a subsequence of A if there exists a strictly increasing sequence ( i1 is a subsequence of... 阅读全文
posted @ 2016-06-16 09:51 chenximcm 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述Given a polynomial and the value of the variable x, you task is to calculate the value of the polynomial.二、输入The first line of the inpu... 阅读全文
posted @ 2016-06-16 00:10 chenximcm 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述One day, WXYZ got a wooden stick, he wanted to split it into three sticks and make a right-angled triangle. You will be given the lengt... 阅读全文
posted @ 2016-06-15 23:42 chenximcm 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述假设一个字符串只由字符‘0’,‘1’,‘?’组成,其中字符‘?’表示该字符可由字符‘0’或‘1’替代。现有一些字符串,根据这些字符串生成所有可生成的字符串。如:{10,?1,0? }可生成{10,01,11,00}{101,001,?01}可生成{101,001}注意后... 阅读全文
posted @ 2016-06-15 23:21 chenximcm 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述有红黄蓝3种颜色的n个珠子,师傅希望悟空把它们排成红色珠子在左,黄色珠子居中,蓝色珠子在右的一行,然后告诉师傅,从左数起,第m个珠子是什么颜色。众所周知,悟空是只猴子,他没有这个耐心,你帮帮他吧。二、输入输入第一行为一个整数t(0三、输出为每个测试用例单独一行输出指定的... 阅读全文
posted @ 2016-06-13 23:21 chenximcm 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述A common divisor for two positive numbers is a number which both numbers are divisible by. It’s easy to calculate the greatest common d... 阅读全文
posted @ 2016-06-13 23:13 chenximcm 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 一、题目描述The number 151 is a prime palindrome because it is both a prime number and a palindrome (it is the same number when read forward as bac... 阅读全文
posted @ 2016-06-13 22:52 chenximcm 阅读(202) 评论(0) 推荐(0) 编辑