2018年3月9日
摘要:
Problem DescriptionGiven a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up ...
阅读全文
posted @ 2018-03-09 20:03
zitian246
阅读(137)
推荐(0)
2017年12月26日
摘要:
有这样一段程序,fun会对整数数组A进行求值,其中Floor表示向下取整:fun(A) sum = 0 for i = 1 to A.length for j = i+1 to A.length sum = sum + ...
阅读全文
posted @ 2017-12-26 13:54
zitian246
阅读(122)
推荐(0)
2017年12月20日
摘要:
在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。如2 4 3 1中,2 1,4 3,4 1,3 1是逆序,逆序数是4。给出一个整数序列,求该序列的逆序数。Input第1行:N...
阅读全文
posted @ 2017-12-20 21:29
zitian246
阅读(122)
推荐(0)
2017年12月18日
摘要:
给出一个数N,求1至N中,有多少个数不是2 3 5 7的倍数。 例如N = 10,只有1不是2 3 5 7的倍数。Input输入1个数N(1 #include typedef long long ll;int main(){ ll a; ll b; ...
阅读全文
posted @ 2017-12-18 20:28
zitian246
阅读(149)
推荐(0)
2017年12月9日
摘要:
在一个叫奥斯汀的城市,有n个小镇(从1到n编号),这些小镇通过m条双向火车铁轨相连。当然某些小镇之间也有公路相连。为了保证每两个小镇之间的人可以方便的相互访问,市长就在那些没有铁轨直接相连的小镇之间建造了公路。在两个直接通过公路或者铁路相连的小镇之间移动,要花费一个小...
阅读全文
posted @ 2017-12-09 19:18
zitian246
阅读(130)
推荐(0)
2017年12月8日
摘要:
The binomial coefficient C(m, n) is defined as C(m, n) = m!(m − n)! n!Gi...
阅读全文
posted @ 2017-12-08 22:03
zitian246
阅读(108)
推荐(0)
2017年12月6日
摘要:
You have an array a with length n, you can perform operations. Each operation is like this: choose two adjacent elements from a, say x...
阅读全文
posted @ 2017-12-06 21:22
zitian246
阅读(133)
推荐(0)
摘要:
Hands that shed innocent blood!There are n guilty people in a line, thei-th of them holds a claw with length Li. The bell rings and ev...
阅读全文
posted @ 2017-12-06 21:09
zitian246
阅读(157)
推荐(0)
摘要:
There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li ...
阅读全文
posted @ 2017-12-06 21:02
zitian246
阅读(142)
推荐(0)
摘要:
The Yongzheng Emperor (13 December 1678 – 8 October 1735), was the fifth emperor of the Qing dynasty of China. He was a very hard-work...
阅读全文
posted @ 2017-12-06 20:57
zitian246
阅读(246)
推荐(0)