导弹拦截第二问贪心也过不了了吗??

P1020 [NOIP1999 提高组] 导弹拦截

你sort n遍是什么意思?
by 142857cs @ 2019-07-07 14:30:32


@[BigYellowDog](/space/show?uid=91681) ``` for(int i = 2; i <= n; i++) { sort(d + 1, d + 1 + cnt); //这句 int pos = lower_bound(d + 1, d + 1 + cnt, a[i]) - d; if(pos == cnt + 1) cnt++; d[pos] = a[i]; } ``` sort了n遍能过才见了鬼了……
by x义x @ 2019-07-07 15:01:25


@[142857cs](/space/show?uid=35760) @[x义x](/space/show?uid=58567) 原来如此。蟹蟹!
by Error_666 @ 2019-07-07 16:47:27


|