摘要: Description An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the p 阅读全文
posted @ 2020-02-18 21:23 陈墨cacm 阅读(86) 评论(0) 推荐(0) 编辑
摘要: Problem Description把一个偶数拆成两个不同素数的和,有几种拆法呢? Input输入包含一些正的偶数,其值不会超过10000,个数不会超过500,若遇0,则结束。 Output对应每个偶数,输出其拆成不同素数的个数,每个结果占一行。 Sample Input30 26 0 Sampl 阅读全文
posted @ 2020-02-18 21:17 陈墨cacm 阅读(529) 评论(0) 推荐(0) 编辑
摘要: N个整数组成的循环序列a11,a22,a33,…,ann,求该序列如aii+ai+1i+1+…+ajj的连续的子段和的最大值(循环序列是指n个数围成一个圈,因此需要考虑an−1n−1,ann,a11,a22这样的序列)。当所给的整数均为负数时和为0。 例如:-2,11,-4,13,-5,-2,和最大 阅读全文
posted @ 2020-02-18 21:12 陈墨cacm 阅读(80) 评论(0) 推荐(0) 编辑
摘要: There is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were 阅读全文
posted @ 2020-02-18 21:05 陈墨cacm 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Matrix multiplication problem is a typical example of dynamical programming. Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D a 阅读全文
posted @ 2020-02-18 20:54 陈墨cacm 阅读(110) 评论(0) 推荐(0) 编辑