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…