02 2019 档案
摘要:一、巴什博弈(Bash Game) 只有一堆n个物品,两个人从轮流中取出(1~m)个;最后取光者胜。 考虑到 若n=m+1 那么 第一个人不论如何取都不能取胜。 进一步我们发现 若 n=k*(m+1)+r; 先取者拿走 r 个,那么后者再拿(1~m)个 n=(k-1)*(m+1)+s; 先取者再拿走
阅读全文
摘要:Problem DescriptionToday the company has m tasks to complete. The ith task need xi minutes to complete. Meanwhile, this task has a difficulty level yi
阅读全文
摘要:1.LIS的定义: 最长上升子序列(longest increasing subsequence),也可以叫最长非降序子序列,简称LIS,不是太难。即一个数的序列bi,当b1 < b2 < … < bS的时候,我们称这个序列是上升的。对于给定的一个序列(a1, a2, …, aN),我们可以得到一些
阅读全文
摘要:Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! InputOne N in one line, process to the end of file. OutputFor each N, output N! in one
阅读全文
摘要:DescriptionWe know that prime numbers are positive integers that have exactly two distinct positive divisors. Similarly, we'll call a positive integer
阅读全文
摘要:Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and decided to pl
阅读全文
摘要:Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some
阅读全文
摘要:Vanya walks late at night along a straight street of length l, lit by n lanterns. Consider the coordinate system with the beginning of the street corr
阅读全文
摘要:Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of ol
阅读全文