HDU 3397. Sequence operation

Brief description: … lxh…


·

Brief description:

… lxhgww got a sequence contains n characters which are all ‘0’s or ‘1’s. We have five operations here:

    Change operations:

  • 0 a b: change all characters into ‘0’s in [a, b]. (区间赋值
  • 1 a b: change all characters into ‘1’s in [a, b]. (区间赋值
  • 2 a b: change all ‘0’s into ‘1’s and change all ‘1’s into ‘0’s in [a, b]. (区间取反
    Output operations:

  • 3 a b: output the number of ‘1’s in [a, b].
  • 4 a b: output the length of the longest continuous ‘1’ string in [a , b].

Analysis:

… 略)
。。单标记。。暴力 rev。。700ms+
。。双标记。。1100ms+

External link:

…

Discussion

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。