题目链接: acm.hdu.edu.cn/showproblem.php?pid=4747 Mex Time Limit: 15000/5000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others) 问题描述 Mex is a function on a set of integers, which is universally used for impartial game theorem. For a non-negative i…
Queuing Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6639 Accepted Submission(s): 2913 Problem Description Queues and Priority Queues are data structures which are known to most computer…
题意:有一队人(人数 ≥ 1),开头一个人要将消息传到末尾一个人那里,规定每次最多可以向后传n个人,问共有多少种传达方式. 这道题我刚拿到手没有想过 DP ,我觉得这样传消息其实很像 Fibonacci 所举的例子:一个人每次能够跨一或二阶台阶,问到 n 阶台阶有几种跨法.理念是一样的,只不过跨得台阶数可能会变而已.根据 Fibonacci 数列类比过来,每次最多能传 m 人,则 A [ i ] = A [ i - m ] + A [ i - m + 1 ] + …… + A [ i - 1…
Problem Description Queues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life. There are many people lined up at the lunch time. Now we define that ‘f’ is short for female a…
The mook jong Accepts: 506 Submissions: 1281 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) 问题描述 ZJiaQ为了强身健体,决定通过木人桩练习武术.ZJiaQ希望把木人桩摆在自家的那个由1*1的地砖铺成的1*n的院子里.由于ZJiaQ是个强迫症,所以他要把一个木人桩正好摆在一个地砖上,由于木人桩手比较长,所以两个木人桩之间地砖必须大于等…