C. Writing Code(Codeforces Round #302(div2)

Programmers working on a large project have just received a task to write exactlymlines of code. There arenprogrammers working on a project, thei-th of them makes exactlyaibugs in every line of code that he writes.

Let’s call a sequence of non-negative integersv1,v2,…,vnaplan, ifv1+v2+…+vn=m. The programmers follow the plan like that: in the beginning the first programmer writes the firstv1lines of the given task, then the second programmer writesv2more lines of the given task, and so on. In the end, the last programmer writes the remaining lines of the code. Let’s call a plangood, if all the written lines of the task contain at mostbbugs in total.

Your task is to determine how many distinctgoodplans are there. As the number of plans can be large, print the remainder of this number modulo given positive integermod.

,属于自己的不要放弃,已经失去的留作回忆。

C. Writing Code(Codeforces Round #302(div2)

相关文章:

你感兴趣的文章:

标签云: