版本比较
P14567 【MX-S12-T2】区间
正文
增加 2 行删除 2 行
116 行未改动全部展开11711811912012112112212312412515 行未改动1411421431441451451461471481497 行未改动116 行未改动全部展开 q.push ( ne[l] ) ; if ( r_max <= l ) continue ;//如果【最大位置+1】比左端点小,显然无合法区间
int r = ne[l] ;//右端点
while ( 1 ){//向右移右端点 int w = s.query_max ( 1 , 1 , n , l , r ) ; if ( r >= r_max ){//如果大于等于【最大位置+1】则无合法区间 ca = false ;//标记,无合法区间15 行未改动 int res = 0 ; for ( int j = a[i].l ; j <= a[i].r ; ++j ){ res += v[j] * f[j-a[i].l+1] ; } ans = min ( ans , res ) ; ans = min ( ans , res ) ;
//计算、更新答案 } L = a[i+1].l , R = a[i+1].r ;7 行未改动