{"id":759,"date":"2013-06-27T01:02:33","date_gmt":"2013-06-26T17:02:33","guid":{"rendered":"http:\/\/www.shuizilong.com\/house\/?p=759"},"modified":"2013-06-27T02:36:55","modified_gmt":"2013-06-26T18:36:55","slug":"hdu-3397-sequence-operation","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/house\/archives\/hdu-3397-sequence-operation\/","title":{"rendered":"HDU 3397. Sequence operation"},"content":{"rendered":"<p><!--more--><\/p>\n<h3>Brief description: <\/h3>\n<p>&#8230; lxhgww got a sequence contains n characters which are all &#8216;0&#8217;s or &#8216;1&#8217;s. We have five operations here:<\/p>\n<ul>Change operations:<\/p>\n<li><code>0 a b<\/code>: change all characters into &#8216;0&#8217;s in <code>[a, b]<\/code>. (\u533a\u95f4\u8d4b\u503c <\/li>\n<li><code>1 a b<\/code>: change all characters into &#8216;1&#8217;s in <code>[a, b]<\/code>. (\u533a\u95f4\u8d4b\u503c <\/li>\n<li><code>2 a b<\/code>: change all &#8216;0&#8217;s into &#8216;1&#8217;s and change all &#8216;1&#8217;s into &#8216;0&#8217;s in <code>[a, b]<\/code>. (\u533a\u95f4\u53d6\u53cd <\/li>\n<\/ul>\n<ul>\nOutput operations:<\/p>\n<li><code>3 a b<\/code>: output the number of &#8216;1&#8217;s in <code>[a, b]<\/code>.<\/li>\n<li><code>4 a b<\/code>: output the length of the longest continuous &#8216;1&#8217; string in <code>[a , b]<\/code>.<\/li>\n<\/ul>\n<h3>Analysis: <\/h3>\n<p>&#8230; \u7565\uff09<br \/>\n<a href=\"http:\/\/acm.hust.edu.cn\/vjudge\/contest\/viewSource.action?id=1236033\">\u3002\u3002\u5355\u6807\u8bb0\u3002\u3002\u66b4\u529b rev\u3002\u3002700ms+<\/a><br \/>\n<a href=\"http:\/\/acm.hust.edu.cn\/vjudge\/contest\/viewSource.action?id=1236050\">\u3002\u3002\u53cc\u6807\u8bb0\u3002\u30021100ms+<\/a><\/p>\n<h3>External link: <\/h3>\n<p>&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[47],"tags":[],"class_list":["post-759","post","type-post","status-publish","format-standard","hentry","category-hdu"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2tdP7-cf","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/comments?post=759"}],"version-history":[{"count":1,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/759\/revisions"}],"predecessor-version":[{"id":760,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/759\/revisions\/760"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/media?parent=759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/categories?post=759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/tags?post=759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}