状态表示: \(f[len][cnt]\):当前为len位,已经统计的$0$的个数为cnt,不计前导$0$。 注意点: 由于前导$0$标识符lead的存在,如果左边界为$0$需要作加一处理。 LL f[15][15]; int a[15]; LL dfs(int len,int cnt,bool l ...
分类:
其他好文 时间:
2021-02-22 12:28:38
阅读次数:
0
状态表示: dp[len][sta]表示当前第len位,上一位为last的情况下满足条件的数的个数。 int f[15][10]; int a[15]; int l,r; int dfs(int len,int last,bool limit) { if(!len) return 1; if(!li ...
分类:
其他好文 时间:
2021-02-22 12:12:38
阅读次数:
0
Problem Description Bruce Force has had an interesting idea how to encode strings. The following is the description of how the encoding is done:Let x1 ...
分类:
其他好文 时间:
2021-02-19 13:18:41
阅读次数:
0
原题链接 考察:记忆化搜索 思路: 可用递推和记忆化搜索两种方式. 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 #include <cstdio> 5 using namespace std; 6 const ...
分类:
其他好文 时间:
2021-02-19 13:15:23
阅读次数:
0
原题链接 考察:树形dp 树的重心变种题 重心定义:重心是指树中的一个结点,如果将这个点删除后,剩余各个连通块中点数的最大值最小,那么这个节点被称为树的重心。(不止一个) 模板题 树的重心 思路: 把树的某个点删去后,剩余部分是不包含父节点的子节点连通块.已经删去点的父节点连通块.通过dfs可以求出 ...
分类:
其他好文 时间:
2021-02-19 13:01:00
阅读次数:
0
原题链接 考察:状压dp 思路: 考虑到计算三角形,我们需要知道落脚点i和前一个落脚点j,所以需要三维数组.根据状态转移方程f[i][j][k] = f[i-{j}][k][t]+score很容易求出最大的权值.但是比较难想到怎么计算路径数目(对本蒟蒻而言).方法是再声明一个记录当前路径最大值的方案 ...
分类:
其他好文 时间:
2021-02-17 14:41:52
阅读次数:
0
第一步 搭建运行环境 参考 mybatis 多对一查询的两种实现方式 第二步 编写代码 1、创建实体类Teacher和Student,一个老师给多个学生上课,一对多关系 Student package com.xiahui.pojo; import lombok.AllArgsConstructor ...
分类:
其他好文 时间:
2021-02-16 12:40:40
阅读次数:
0
\(\text{原题链接}\) \(\text{题目大意}\) 初始有一个长度为 \(n\) 的序列 \(a\),初始全 \(0\)。 共 \(m\) 次修改,每次修改 \((l,r,v)\),让 \(a_i = \max(a_i, v), (l\leq i\leq r)\)。求出所有操作后的 \( ...
分类:
其他好文 时间:
2021-02-15 12:15:44
阅读次数:
0
501 / 529 A HDU 5007 Post Robot 83 / 443 B HDU 5008 Boring String Problem !!! 111 / 784 C HDU 5009 Paint Pearls +++ 6 / 57 D HDU 5010 Get the Nut ??? ...
分类:
其他好文 时间:
2021-02-09 12:32:36
阅读次数:
0
题目描述: http://acm.hdu.edu.cn/showproblem.php?pid=1043 中文大意: 经典八数码问题。 给定初始状态,要求变换到目标状态并输出移动过程。 目标状态固定为:1 2 3 4 5 6 7 8 x 。 思路: 采用逆向 BFS + 康托展开判重 + 打表的方法 ...
分类:
其他好文 时间:
2021-02-08 12:12:13
阅读次数:
0