正文
增加 8 行删除 8 行
33 行未改动3435363738394041424344454 行未改动50515253545556575866 行未改动12512612712812913013113213311 行未改动14514614714814915015115215315415515615715833 行未改动## 代码```cpp/** @Author: chhokmah* @Date: 2020-03-22 16:20:53* @Last Modified by: chhokmah* @Last Modified time: 2020-03-22 16:20:53*/#include <bits/stdc++.h>using namespace std;4 行未改动struct Node {int i, l, r;Node() {i = l = r = 0;}Node(int x, int y, int z) {66 行未改动if (f[n] > 1e18) {cout << "Too hard to arrange" << '\n';} else {cout << (long long)f[n] << '\n';vector<int> pt;pt.clear();int it = n;while (it) {pt.emplace_back(it);11 行未改动if (t != 0) {cout << '\n';}}return 0;}```## 后言- 考虑了 $DP$,如果时间复杂度比较劣,那么考虑决策点是否有**单调性或者其他特殊性质**,可以通过打表或者其他方法得出规律。就比如说 $JOISC \;2020 \;Day1$ 中 $DP$ 的决策点就有明显的连续性。- 四边形不等式优化的条件是**外大于里,包含大于相交**。- 用单调队列优化 $DP$ 时一定要关注**边界问题**。33 行未改动3435363738394041424344454 行未改动50515253545556575866 行未改动12512612712812913013113213311 行未改动14514614714814915015115215315415515615715833 行未改动## 代码```cpp/** @Author: chhokmah* @Date: 2020-03-22 16:20:53* @Last Modified by: chhokmah* @Last Modified time: 2020-03-22 16:20:53*/#include <bits/stdc++.h>using namespace std;4 行未改动struct Node {int i, l, r;Node() {i = l = r = 0;}Node(int x, int y, int z) {66 行未改动if (f[n] > 1e18) {cout << "Too hard to arrange" << '\n';} else {cout << (long long)f[n] << '\n';vector<int> pt;pt.clear();int it = n;while (it) {pt.emplace_back(it);11 行未改动if (t != 0) {cout << '\n';}}return 0;}```## 后言- 考虑了 $DP$,如果时间复杂度比较劣,那么考虑决策点是否有**单调性或者其他特殊性质**,可以通过打表或者其他方法得出规律。就比如说 $JOISC \;2020 \;Day1$ 中 $DP$ 的决策点就有明显的连续性。- 四边形不等式优化的条件是**外大于里,包含大于相交**。- 用单调队列优化 $DP$ 时一定要关注**边界问题**。