#include<cstdio> #include<cstring> #include<climits> #include<algorithm> usingnamespacestd; const int Mn(10050),Mm(1050); constintINF(0x3f3f3f3f); int dp[Mn][Mm]; //dp数组 int dly[2][Mn]; //y值变化量, dly[0]为下降, dly[1]为上升 int ppl[Mn],pph[Mn]; //管缝下边沿, 管缝上边沿 int ppn[Mn]; //某位置的管缝编号