Dice (I) You have N dices; each of them has K faces numbered from 1 to K. Now you have arranged the N dices in a line. You can rotate/flip any dice if you want. How many ways you can set the top faces such that the summation of all the top faces eq…
ABCDE 题目连接: http://acm.uestc.edu.cn/#/problem/show/1307 Description Binary-coded decimal (BCD) is a kind of binary encodings of decimal numbers where each decimal digit is represented by a fixed number of bits. Awesome Binary-Coded Decimal (ABCD) is,…
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3398 好简单呀.而且是自己想出来的. dp[ i ]表示最后一个牡牛在 i 的方案数. 当前位置放牝牛,之前的dp[ k ]不变:当前位置放牡牛,出现了dp[ i ],值是距离大于k的dp[ j ]的和,所以可以前缀和优化. 当然有dp[0]啦. #include<iostream> #include<cstdio> #include<cstring> using…
C. Riding in a Lift Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/480/problem/C Description Imagine that you are in a building that has exactly n floors. You can move between the floors in a lift. Let's number the floors f…