思路: 二分L 考虑check 搞出在i用法杖可以到达的最远的法坛j,然后dp 从上一个最远的法杖+1开始使用,然后转移 c o d e code code #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int n, r, g; int a[2010], p[2010], q[2010], f[2010][2010]; bool check