摘要: 考虑 DP。 令 fi,0/1f_{i,0/1}fi,0/1​ 表示当前打完了第 iii 个字母,且 Capslock 现在处于开启或关闭时的代价最小值。 于是可以进行线性 DP。 #include <bits/stdc++.h> using namespace std; const int N = 阅读全文
posted @ 2023-05-28 16:31 HappyBobb 阅读(11) 评论(0) 推荐(0)
摘要: 直接模拟即可。 #include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; int dx[] = { 0, 0, -1, 1 }; int dy[] = { -1, 1, 0, 0 }; int n, m, h, k; s 阅读全文
posted @ 2023-05-28 15:48 HappyBobb 阅读(20) 评论(0) 推荐(0)