标签 - 动态规划

? 解题记录 ? ? Codeforces ? ? 动态规划 ? ? 数位dp ? ? 搜索 ?    2018-09-13 22:52:19    493    0    0
output standard output Let's call some positive integer classy if its decimal representation contains no more than 3" data-mce-tabindex="0">33 non-zero digits. For example, numbers 4" data-mce-tabindex="0">44, 200000" data-mce-tabindex="0">200000200000, 1
? 解题记录 ? ? 动态规划 ? ? 状态压缩 ?    2018-08-25 08:46:11    960    0    0
【题目描述】给你n个k维0/1向量组成的串a[n]。 定义向量a <= b当且仅当a中每一个1出现的位置在b中都是1 比如{0,1,0,1}<={0,1,0,1}, {0,1,0,1}<={0,1,1,1} 但是{0,1,0,1}和{1,0,0,1}没有这样的关系 现在请你统计这个串中有多少个不下降子序列。 一个子序列是一个1~n组成的序列, 其中每个元素都满足i < j且a[i] <= a[j]。 【输入】第一行两个正整数n,k。n表示串的长度,k表示向量维数 下面n行每一行一个0/1字符串表示一个k维向量 【输出】输出一个整数,表示不下降序列个数。 【输入样例
? 解题记录 ? ? 杂OJ ? ? 容斥 ? ? 动态规划 ? ? 组合数 ?    2018-08-15 08:56:05    1434    0    1
【题目描述】 求n个点的有向图中强连通图的个数,输出答案对10007取模后得结果(无重边,无自环) 定义强连通图为本身是一个强连通分量的图 【输入格式】 输入一个n表示节点个数 【输出格式】 输出题目要求的答案 【样例输入】 【样例输出】 【提示】 样例解释: 只有一个图,即有边<1,2>和边<2,1> 对于30%的数据,n<=7 对于100%的数据,n<=1000 几个月之前想过强连通图的计数问题,发现根本不可做,暑假集训突然就变成作业了…… 这道题的容斥姿势太高超了,功力不够学不来QWQ。 考虑模仿
? 解题记录 ? ? Atcoder ? ? 动态规划 ? ? 构造 ?    2018-07-15 11:00:04    770    0    0
    Problem StatementTaichi thinks a binary string X of odd length N is beautiful if it is possible to apply the following operation  N−12 times so that the only character of the resulting string is 1 :  Choose three consecutive&n
? 解题记录 ? ? Atcoder ? ? 动态规划 ?    2018-07-13 22:49:19    1224    0    0
Problem StatementFind the number of the possible tuples of sequences (A0,A1,…,AN) that satisfy all of the following conditions, modulo M: For every i (0≤i≤N), Ai is a sequence of length i consisting of integers between 1 and K (inclusi
? 解题记录 ? ? HDU ? ? 圆方树 ? ? 动态规划 ?    2018-06-27 21:53:50    506    0    0
Problem Description Professor Zhang has an undirected graph G with n vertices and m edges. Each vertex is attached with a weight wi. Let Gi be the graph after deleting the i-th vertex from graph G. Professor Zhang wants to find the weight of&nbs
? 解题记录 ? ? 洛谷 ? ? 动态规划 ? ? 背包问题 ?    2018-06-25 19:34:04    627    0    0
题目描述Everyone knew it would only be a matter of time. So what? Faced for years on, a peril becomes the every-day reality. It loses its meaning... Today the letter of the Bitotian char Bittard to the Byteotian king Byteasar was released to the public. Bitotia requested annexation of the whole Byteotia
? 解题记录 ? ? 洛谷 ? ? 动态规划 ?    2018-06-24 23:05:30    629    0    0
题目描述有n家洗车店从左往右排成一排,每家店都有一个正整数价格p[i]。有m个人要来消费,第i个人会驶过第a[i]个开始一直到第b[i]个洗车店,且会选择这些店中最便宜的一个进行一次消费。但是如果这个最便宜的价格大于c[i],那么这个人就不洗车了。请给每家店指定一个价格,使得所有人花的钱的总和最大。 输入输出格式输入格式:   第一行包含两个正整数n,m(1<=n<=50,1<=m<=4000)。接下来m行,每行包含三个正整数a[i],b[i],ci   输出格式:   第一行输出一个正整数,即消费总额的最大值。第二行输出n个正整数,依次表
? 解题记录 ? ? 洛谷 ? ? 动态规划 ?    2018-06-24 22:35:15    380    0    0
题目描述The annual rich citizen's reunion is taking place in Byteotia. They meet to boast about their incomes, Lebytene's shoes and other luxuries. Naturally, not all these objects of pride are carried into the banquet - coats, jackets, umbrellas and such are left in the cloakroom, and picked up upon le
? 解题记录 ? ? 洛谷 ? ? 动态规划 ?    2018-06-24 22:31:38    500    0    0
题目描述 A sequence of  integers  from the set  is given. The bytecomputer is a device that allows the following operation on the sequence: incrementing  by  for any . There is no limit on the range of integers the bytecomputer can store, i.e., each