随笔分类 - dp
摘要:Atcoder_ABC230F 点击查看代码 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=2e5+10; const ll mod=998244353; ll dp[maxn],
阅读全文
摘要:D. Weight the Tree 给一棵树,每个点有权重,如果一个点的权重等于它周围直接相连点的权重,就称为好点,求权重的分配方案,使得好点个数最大化,且权重值之和最小, 做法:设$dp[x][1/0]$表示当前点是否作为好点时最大好点数,最小权值,我们可以知道,如果一个点为好点,他周围的点就不
阅读全文

浙公网安备 33010602011771号