摘要:
Problem DescriptionGiven a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up ... 阅读全文
摘要:
有这样一段程序,fun会对整数数组A进行求值,其中Floor表示向下取整:fun(A) sum = 0 for i = 1 to A.length for j = i+1 to A.length sum = sum + ... 阅读全文
摘要:
在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。如2 4 3 1中,2 1,4 3,4 1,3 1是逆序,逆序数是4。给出一个整数序列,求该序列的逆序数。Input第1行:N... 阅读全文
摘要:
给出一个数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; ... 阅读全文
摘要:
在一个叫奥斯汀的城市,有n个小镇(从1到n编号),这些小镇通过m条双向火车铁轨相连。当然某些小镇之间也有公路相连。为了保证每两个小镇之间的人可以方便的相互访问,市长就在那些没有铁轨直接相连的小镇之间建造了公路。在两个直接通过公路或者铁路相连的小镇之间移动,要花费一个小... 阅读全文
摘要:
The binomial coefficient C(m, n) is defined as C(m, n) = m!(m − n)! n!Gi... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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 ... 阅读全文
摘要:
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... 阅读全文