随笔分类 -  动态规划-状压dp

摘要:题意 求只用 $\{0, 1, 2, 3, 4\}$ 五个数每个数最多使用 $a_i$ 次且没有前导零所能组成的 $n$ 位数的数量,答案模 $1e9+7$。 思路 貌似可以母函数+FFT ~~(但是这两个我都不会~~ 也可以用状压dp + 容斥原理来求解。 这个题求合法数不好求,所以可以计算总数减 阅读全文
posted @ 2019-09-28 23:12 Acerkoo 阅读(308) 评论(0) 推荐(0)
摘要:题目描述 对于一个长度问n的数组A,设第i个元素为Ai(0≤i 3 5 7 5 样例输出 1 hint 思路 逆向思考,总数减去不满足条件的数量。 既然 x+y+z using namespace std; const int maxm = 1 阅读全文
posted @ 2019-05-26 22:34 Acerkoo 阅读(280) 评论(0) 推荐(0)
摘要:题目描述 You are supposed to play the rock paper scissors game. There are N players including you. This game consists of multiple rounds. While the rounds 阅读全文
posted @ 2019-05-26 20:21 Acerkoo 阅读(178) 评论(0) 推荐(0)