版本比较
题解:CF2200F Mooclear Reactor 2
正文
增加 1 行删除 1 行
59 行未改动60616263646566676811 行未改动59 行未改动for( int i = 1 ; i <= n + 1 ; i ++ ) maxx = max( maxx , f[i] ),g[i] = max( g[i] , g[i - 1] );for( int i = 1 ; i <= m ; i ++ ){int x,y; scanf("%lld%lld",&x,&y); y ++;//case1:不选//case2:选,此时原序列中选的数量不超过 y-1。在原序列上选择不超过//强制选它的话,所有决策撤掉一项后取个最大值int res = max( maxx , g[y] + x );// if( y > 1 ) res = max( res , prem[y - 2] + x );printf("%lld ",res);11 行未改动59 行未改动60616263646566676811 行未改动59 行未改动for( int i = 1 ; i <= n + 1 ; i ++ ) maxx = max( maxx , f[i] ),g[i] = max( g[i] , g[i - 1] );for( int i = 1 ; i <= m ; i ++ ){int x,y; scanf("%lld%lld",&x,&y); y ++;//case1:不选//case2:选,此时原序列中选的数量不超过 y-1。在原序列上选择不超过//强制选它的话,所有决策撤掉一项后取个最大值int res = max( maxx , g[y] + x );// if( y > 1 ) res = max( res , prem[y - 2] + x );printf("%lld ",res);11 行未改动