基础知识
Mrzhq7
这个作者很懒,什么都没留下…
展开
-
母牛的故事
有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛?Input输入数据由多个测试实例组成,每个测试实例占一行,包括一个整数n(0<n<55),n的含义如题目中描述。 n=0表示输入数据的结束,不做处理。Output对于每个测试实例,输出在第n年的时候母牛的数量。 每个输出占一行。Sample Input24...原创 2018-04-14 19:56:47 · 163 阅读 · 0 评论 -
B - Pythagorean Theorem II
n mathematics, the Pythagorean theorem — is a relation in Euclidean geometry among the three sides of a right-angled triangle. In terms of areas, it states:In any right-angled triangle, the area of th...原创 2018-04-17 16:38:08 · 212 阅读 · 0 评论 -
C - Candies
Polycarpus has got n candies and m friends (n ≥ m). He wants to make a New Year present with candies to each friend. Polycarpus is planning to present all candies and he wants to do this in the faires...原创 2018-04-17 16:57:02 · 544 阅读 · 0 评论 -
Magic Numbers
A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and ...原创 2018-04-20 11:20:24 · 527 阅读 · 0 评论 -
Lara Croft and the New Game
You might have heard about the next game in Lara Croft series coming out this year. You also might have watched its trailer. Though you definitely missed the main idea about its plot, so let me lift t...原创 2018-06-02 17:17:28 · 444 阅读 · 0 评论 -
Minimum Inversion Number
The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj. For a given sequence of numbers a1, a2, ..., an, if we move the fi...原创 2018-05-29 21:04:09 · 204 阅读 · 0 评论