{"width":"100%","provider_url":"https://hatena.blog","blog_url":"https://torus711.hatenablog.com/","height":"190","image_url":null,"type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftorus711.hatenablog.com%2Fentry%2F2024%2F02%2F18%2F234651\" title=\"AtCoder Beginner Contest 341, E : Alternating String - torus711 \u306e\u30a2\u30ec\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":["AtCoder","Segment Tree"],"provider_name":"Hatena Blog","published":"2024-02-18 23:46:51","blog_title":"torus711 \u306e\u30a2\u30ec","author_url":"https://blog.hatena.ne.jp/torus711/","author_name":"torus711","version":"1.0","url":"https://torus711.hatenablog.com/entry/2024/02/18/234651","title":"AtCoder Beginner Contest 341, E : Alternating String","description":"\u554f\u984c\u6587 https://atcoder.jp/contests/abc341/tasks/abc341_e \u554f\u984c\u6982\u8981 $0$ \u3068 $1$ \u304b\u3089\u306a\u308b $n$ \u8981\u7d20\u306e\u5217 $S = S_1, S_2, \\dots S_n$ ($S_i \\in { 0, 1 }$) \u304c\u4e0e\u3048\u3089\u308c\u308b\uff0e\u30af\u30a8\u30ea\u304c $q$ \u500b\u4e0e\u3048\u3089\u308c\u308b\u306e\u3067\uff0c\u9806\u306b\u51e6\u7406\u305b\u3088\uff0e\u30af\u30a8\u30ea\u306f\u4ee5\u4e0b\u306e 2 \u7a2e\u985e\u304b\u3089\u306a\u308b\uff1a $( 1, l, r )$ : $l \\leq i \\leq r$ \u306a\u308b $i$ \u306b\u3064\u3044\u3066\uff0c$$S_i \\leftarrow 1 - S_i$$ \u3068\u66f4\u65b0\u3059\u308b*1\uff0e $( 2, l, r )$ : $l \\leq i \u5236\u7d04 $1 \\leq n\u2026"}