摘要:
感到疑惑 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5010; LL f[N][N],sum[N]; int main(){ int n,m,k,a; cin>>n>>m>>k; 阅读全文
posted @ 2022-05-10 22:31
xhy666
阅读(31)
评论(0)
推荐(0)
摘要:
步数 <= 3n的做法:从左到右遍历原串,遇到与目标串不符的位就进行一次操作(每次操作包含三步) 步数 <= 2n的做法:从左到右遍历原串,如果s[i]!=s[i+1]就进行一次操作(每次操作包含一步),这样总能将原串变为均为1或均为0,目标串同理 #include<bits/stdc++.h> u 阅读全文
posted @ 2022-05-10 18:49
xhy666
阅读(32)
评论(0)
推荐(0)
摘要:
状压dp,模板 f[i][j]表示以i为当前状态,j为终点的路径长度,属性:min #include<bits/stdc++.h> using namespace std; const int N = 21,M = 1<<20; int f[M][N],weight[N][N]; int main( 阅读全文
posted @ 2022-05-10 12:50
xhy666
阅读(51)
评论(0)
推荐(0)

浙公网安备 33010602011771号