﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-250的oi之路-随笔分类-oi</title><link>http://www.cppblog.com/wwy250/category/9749.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 30 Jun 2009 11:26:26 GMT</lastBuildDate><pubDate>Tue, 30 Jun 2009 11:26:26 GMT</pubDate><ttl>60</ttl><item><title>这里的最后一篇</title><link>http://www.cppblog.com/wwy250/archive/2009/06/29/88765.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Mon, 29 Jun 2009 05:41:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/06/29/88765.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/88765.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/06/29/88765.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/88765.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/88765.html</trackback:ping><description><![CDATA[首先庆祝中考结束 祝广大中考er取得优异成绩<br /><br />现在说回我吧<br />关注我的blog的朋友可能发现 我这里已经好久没更新了<br />这还要从CTSC&amp;APIO说起<br />话说那两次比赛考得很伪 究其原因 恐怕还是学习方法的问题<br />在这方面JL的oier有着得天独厚的劣势<br />所以 我经常说 作为一个弱省的oier 不要怕走弯路 这一定是必经的过程<br />在那次回来之后 我就再也没有写blog 原因大概就是对自己今年Au 失去了像CTSC之前那么强的信心 甚至怕省选落选 每天就做做各省省选题 心想Ag就不错了<br />后来省选又结束了 我以第二名的成绩进队 其实也是情理之中的<br />之后就是做做NOI 好多题都不能AC 但是要是把力所能及的点都做上 还不Au线高不少 这让我又有了一点点幻想 但我深知基本不会有人在NOI吧力所能及的点都答上的<br />这两天去参加中考 其实就是考这玩 我上高中一定是要靠OI的成绩的<br />参加中考见到了许多同学 半年没见到这么多同学了 还是这些同学好<br />在那个圈子里 没人会认为你是神牛 没人会认为你可能进国家队甚至IOI Au 也没人把你当小朋友 即使相信也不会有不断的orz 不会吝啬批评和鄙视甚至是鸡蛋里挑骨头<br />虽然少了写前辈与众心肠的话 但是却显得特别的真实<br />由于我们班是最BT的班 所以我的同学们也就都选择了最BT的高中 合适JL省太不重视OI了 所以我一定要去的Au才能保证高中也和他们在一起<br />为了同学们 为了不辜负当年手把手教我oi的lpq、给我讲了无数题的zys、在我孤独是陪伴我的wh 以及好多好多人<br />就让我再修炼28天 在NOI取得Au吧<br /><br />这将是我这个blog的最后一篇blog 这次NOI之前先不写blog了 等这次NOI之后 重新开个blog<br />另外看了几个我们同学的blog发现原来blog不止是写解题报告的 尤其是<font size="5"><a target="_blank" href="http://user.qzone.qq.com/530362347?ptlang=2052">这个</a></font>写的太NB了<br /><br />不Au就要离开他们了 5555555555555555555<br />不过即使不在一起上学 哪个学校的oi老师都会欢迎我的 想见还是能见到 而且可以经常见<br /><br /><br /><br /><br /><img src ="http://www.cppblog.com/wwy250/aggbug/88765.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-06-29 13:41 <a href="http://www.cppblog.com/wwy250/archive/2009/06/29/88765.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CTSC&amp;APIO 09</title><link>http://www.cppblog.com/wwy250/archive/2009/05/03/81785.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Sun, 03 May 2009 12:14:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/05/03/81785.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/81785.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/05/03/81785.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/81785.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/81785.html</trackback:ping><description><![CDATA[CTSC APIO 09在即<br />虽然我很重视这两个比赛(尤其是前者) 但我并没有特意为他们准备 这是按照至NOI09的计划进行着<br />不敢奢望能取得什么太好的成绩 但总不能让我自己掏比赛费可车票(我们学校规定 Ag或以上成绩可以报销)<br />下面将写下我的比赛成绩由于事情还没有发生 所以现在还不能写 期望回来的时候不要让我不好意思写<br /><img src ="http://www.cppblog.com/wwy250/aggbug/81785.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-05-03 20:14 <a href="http://www.cppblog.com/wwy250/archive/2009/05/03/81785.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>NOI 09 还有3个月</title><link>http://www.cppblog.com/wwy250/archive/2009/04/27/81274.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Mon, 27 Apr 2009 14:53:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/04/27/81274.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/81274.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/04/27/81274.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/81274.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/81274.html</trackback:ping><description><![CDATA[3个月<br />在于何林的聊天中不止一次表示3个月足以变得很强<br />他还鼓励我今年进集训队 叫我自信<br />现在足以改变一切的3个月终于到来了<br />希望借何林神牛的吉言 用3个月 原了我的Au梦<br /><img src ="http://www.cppblog.com/wwy250/aggbug/81274.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-04-27 22:53 <a href="http://www.cppblog.com/wwy250/archive/2009/04/27/81274.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>后缀数组</title><link>http://www.cppblog.com/wwy250/archive/2009/04/14/79874.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Tue, 14 Apr 2009 04:29:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/04/14/79874.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/79874.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/04/14/79874.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/79874.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/79874.html</trackback:ping><description><![CDATA[曾经看过许XX的论文 不过没有看懂<br />09年罗XX的论文比那篇容易理解的多 <br />后缀数组果然是一个很强大的东西 有关字符串的问题 只要学好自动机和后缀数组基本都能解决了<br />与其说是后缀数组强大 不如说height数组强大 后缀数组的作用也就是方便求解height数组<br />使用height数组 大致有如下你个常用方法<br />1、分组:将height值大于等于k的分置一组 使得同组内最长公共前缀&gt;=k<br />2、二分:根据具体情况 一般都是二分答案<br />3、连接：将所有涉及到的字符串连在一起处理<br />还有一个神奇的性质:当循环节长度确定时 保证覆盖是s[0],s[l],s[l*2]～～中的某连续两个<br /><img src ="http://www.cppblog.com/wwy250/aggbug/79874.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-04-14 12:29 <a href="http://www.cppblog.com/wwy250/archive/2009/04/14/79874.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>病毒的DNA</title><link>http://www.cppblog.com/wwy250/archive/2009/04/13/79835.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Mon, 13 Apr 2009 15:33:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/04/13/79835.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/79835.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/04/13/79835.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/79835.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/79835.html</trackback:ping><description><![CDATA[花了半天的时间终于 AC 了<br />贴一下代码：<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">#include</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">iostream</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">#define</span><span style="color: rgb(0, 0, 0);"> Rank(x) rank[(x)&lt;?(n+1)]</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);"> std;<br /><br /></span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);"> a[</span><span style="color: rgb(0, 0, 0);">100000</span><span style="color: rgb(0, 0, 0);">],c[</span><span style="color: rgb(0, 0, 0);">5000</span><span style="color: rgb(0, 0, 0);">],b[</span><span style="color: rgb(0, 0, 0);">5000</span><span style="color: rgb(0, 0, 0);">],d[</span><span style="color: rgb(0, 0, 0);">100000</span><span style="color: rgb(0, 0, 0);">];<br /></span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> sa[</span><span style="color: rgb(0, 0, 0);">5001</span><span style="color: rgb(0, 0, 0);">],height[</span><span style="color: rgb(0, 0, 0);">5001</span><span style="color: rgb(0, 0, 0);">],rank[</span><span style="color: rgb(0, 0, 0);">5001</span><span style="color: rgb(0, 0, 0);">],n,sum[</span><span style="color: rgb(0, 0, 0);">5001</span><span style="color: rgb(0, 0, 0);">],h[</span><span style="color: rgb(0, 0, 0);">5001</span><span style="color: rgb(0, 0, 0);">],_sa[</span><span style="color: rgb(0, 0, 0);">5001</span><span style="color: rgb(0, 0, 0);">],_rank[</span><span style="color: rgb(0, 0, 0);">5001</span><span style="color: rgb(0, 0, 0);">],m,ans[</span><span style="color: rgb(0, 0, 0);">20</span><span style="color: rgb(0, 0, 0);">][</span><span style="color: rgb(0, 0, 0);">5001</span><span style="color: rgb(0, 0, 0);">],tr[</span><span style="color: rgb(0, 0, 0);">5001</span><span style="color: rgb(0, 0, 0);">],tl[</span><span style="color: rgb(0, 0, 0);">5001</span><span style="color: rgb(0, 0, 0);">],maxk,maxi,lft[</span><span style="color: rgb(0, 0, 0);">100001</span><span style="color: rgb(0, 0, 0);">],rght[</span><span style="color: rgb(0, 0, 0);">100001</span><span style="color: rgb(0, 0, 0);">],leftt[</span><span style="color: rgb(0, 0, 0);">100001</span><span style="color: rgb(0, 0, 0);">],rightt[</span><span style="color: rgb(0, 0, 0);">100001</span><span style="color: rgb(0, 0, 0);">];<br /><br /></span><span style="color: rgb(0, 0, 255);">struct</span><span style="color: rgb(0, 0, 0);"> node<br />{<br />    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> th;<br />    </span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);"> s;<br />}r[</span><span style="color: rgb(0, 0, 0);">10000</span><span style="color: rgb(0, 0, 0);">];<br /><br /></span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> cmps(</span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">a,</span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">b)<br />{<br />    </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">(node </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">)a).s</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">(node </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">)b).s;<br />}<br /><br /></span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> cmpth(</span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">a,</span><span style="color: rgb(0, 0, 255);">const</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">b)<br />{<br />    </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">(node </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">)a).th</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">(node </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">)b).th;<br />}<br /><br /></span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> getsa()<br />{<br />    qsort(r</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">,n,</span><span style="color: rgb(0, 0, 255);">sizeof</span><span style="color: rgb(0, 0, 0);">(node),cmps);<br />    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> p</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">n;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(r[i].s</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);">r[i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">].s)<br />        {<br />            rank[r[i].th]</span><span style="color: rgb(0, 0, 0);">=++</span><span style="color: rgb(0, 0, 0);">p;<br />            sa[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">r[i].th;<br />        }<br />        </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br />        {<br />            rank[r[i].th]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">p;<br />            sa[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">r[i].th;<br />        }<br />     qsort(r</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">,n,</span><span style="color: rgb(0, 0, 255);">sizeof</span><span style="color: rgb(0, 0, 0);">(node),cmpth);<br />     </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> l</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;p</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">n;l</span><span style="color: rgb(0, 0, 0);">&lt;&lt;=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">)<br />     {<br />         memset(sum,</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 255);">sizeof</span><span style="color: rgb(0, 0, 0);">(sum));<br />         memset(h,</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 255);">sizeof</span><span style="color: rgb(0, 0, 0);">(h));<br />         </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">n;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />             </span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">sum[rank[i]</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">];<br />        </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">p;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />            sum[i]</span><span style="color: rgb(0, 0, 0);">+=</span><span style="color: rgb(0, 0, 0);">sum[i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">];    <br />         </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">n</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">l</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">n;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />            _sa[sum[rank[i]]</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">h[rank[i]])]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">i;<br />        </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">n;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />             </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(sa[i]</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">l)<br />                 _sa[sum[rank[sa[i]</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">l]]</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">h[rank[sa[i]</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">l]])]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">sa[i]</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">l;<br />        memcpy(sa,_sa,</span><span style="color: rgb(0, 0, 255);">sizeof</span><span style="color: rgb(0, 0, 0);">(_sa));<br />        p</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br />        </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">n;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />            _rank[sa[i]]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">((rank[sa[i]]</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">rank[sa[i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]])</span><span style="color: rgb(0, 0, 0);">&amp;&amp;</span><span style="color: rgb(0, 0, 0);">(Rank(sa[i]</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">l)</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">Rank(sa[i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">l)))</span><span style="color: rgb(0, 0, 0);">?</span><span style="color: rgb(0, 0, 0);">p:</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">p;<br />        memcpy(rank,_rank,</span><span style="color: rgb(0, 0, 255);">sizeof</span><span style="color: rgb(0, 0, 0);">(_rank));            <br />     }<br />}<br /><br /></span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> getans()<br />{<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">n;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />        ans[</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">][i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">height[i];<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">n;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />        </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> j</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;j</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">n;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">j)<br />            ans[i][j]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">ans[i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">][j]</span><span style="color: rgb(0, 0, 0);">&lt;?</span><span style="color: rgb(0, 0, 0);">ans[i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">][j</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);">(i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">))];<br />}<br /><br /></span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> askRMQ(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> s,</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> t)<br />{<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(t</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">s</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);">i)<br />            </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> ans[i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">][s]</span><span style="color: rgb(0, 0, 0);">&lt;?</span><span style="color: rgb(0, 0, 0);">ans[i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">][t</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);">(i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">))</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">];<br />}<br /><br /></span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> getheight(</span><span style="color: rgb(0, 0, 255);">bool</span><span style="color: rgb(0, 0, 0);"> flag) <br />{<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> k</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">,i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">,j;i</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">n;height[rank[i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">k)<br />        </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(k</span><span style="color: rgb(0, 0, 0);">?--</span><span style="color: rgb(0, 0, 0);">k:</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">,j</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">sa[rank[i]</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">];r[i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">k].s</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">r[j</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">k].s;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">k);<br />     getans();<br />     </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(flag)<br />     {<br />         tr[</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">m;<br />         </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">m;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />             tr[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">askRMQ(rank[</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&lt;?</span><span style="color: rgb(0, 0, 0);">rank[i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">],rank[</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&gt;?</span><span style="color: rgb(0, 0, 0);">rank[i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]);<br />     }<br />     </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br />     {<br />         tl[</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">m;<br />         </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">m;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />             tl[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">askRMQ(rank[</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&lt;?</span><span style="color: rgb(0, 0, 0);">rank[i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">],rank[</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&gt;?</span><span style="color: rgb(0, 0, 0);">rank[i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]);            <br />     }<br />}<br /><br /></span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> main()<br />{<br />    scanf(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">%s</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,a);<br />    scanf(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">%s</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,b);<br />    m</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">strlen(a);<br />    n</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">strlen(b);<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">n;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />    {<br />        r[i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">].s</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">b[i];<br />        r[i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">].th</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br />    }<br />    getsa();<br />    getheight(</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">);<br />    maxk</span><span style="color: rgb(0, 0, 0);">=-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">m;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />    {<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(maxk</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">i)<br />        {<br />            </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> j</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">j)<br />                </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(j</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">n</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">j</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">m</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">a[i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">j]</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);">b[j])<br />                {<br />                    maxk</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">j</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br />                    maxi</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">i;<br />                    rght[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">j;<br />                    </span><span style="color: rgb(0, 0, 255);">break</span><span style="color: rgb(0, 0, 0);">;<br />                }<br />        }<br />        </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br />        {<br />            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(tr[maxi</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&gt;=</span><span style="color: rgb(0, 0, 0);">maxk</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">)<br />                </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> j</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">maxk</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">j)<br />                    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(j</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">n</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">j</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">m</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">a[i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">j]</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);">b[j])<br />                    {<br />                        maxk</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">j</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br />                        maxi</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">i;<br />                        rght[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">j;                        <br />                    }<br />            </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br />                rght[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">tr[maxi</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">];<br />        }<br />    }<br />    maxk</span><span style="color: rgb(0, 0, 0);">=-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">n;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />    {<br />        c[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">r[i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">].s</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">b[n</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">];<br />        r[i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">].th</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br />    }<br />    getsa();<br />    getheight(</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">);<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">m;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />        d[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">a[m</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">];<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">m;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />    {<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(maxk</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">i)<br />        {<br />            </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> j</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">j)<br />                </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(j</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">n</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">j</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">m</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">d[i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">j]</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);">c[j])<br />                {<br />                    maxk</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">j</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br />                    maxi</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">i;<br />                    lft[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">j;<br />                    </span><span style="color: rgb(0, 0, 255);">break</span><span style="color: rgb(0, 0, 0);">;<br />                }<br />        }<br />        </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br />        {<br />            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(tl[maxi</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">]</span><span style="color: rgb(0, 0, 0);">&gt;=</span><span style="color: rgb(0, 0, 0);">maxk</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">)<br />                </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> j</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">maxk</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">j)<br />                    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(j</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">n</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">j</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">m</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">d[i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">j]</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);">c[j])<br />                    {<br />                        maxk</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">j;<br />                        maxi</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">i;<br />                        lft[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">j;                        <br />                    }<br />            </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br />                lft[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">tl[maxi</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">];<br />        }<br />    }<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">m</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&gt;=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;</span><span style="color: rgb(0, 0, 0);">--</span><span style="color: rgb(0, 0, 0);">i)<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(lft[i]</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">n</span><span style="color: rgb(0, 0, 0);">&amp;&amp;</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">n</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);">m)<br />            leftt[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">lft[i]</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">leftt[i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">n];<br />        </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br />            leftt[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">lft[i];<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">m</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&gt;=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;</span><span style="color: rgb(0, 0, 0);">--</span><span style="color: rgb(0, 0, 0);">i)<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(rght[i]</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">n</span><span style="color: rgb(0, 0, 0);">&amp;&amp;</span><span style="color: rgb(0, 0, 0);">i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">n</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);">m)<br />            rightt[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">rght[i]</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">rightt[i</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">n];<br />        </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br />            rightt[i]</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">rght[i];<br />    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> maxl</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">m;</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">i)<br />        maxl</span><span style="color: rgb(0, 0, 0);">&gt;?=</span><span style="color: rgb(0, 0, 0);">rightt[i]</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">leftt[m</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">i];<br />    <br />    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(maxl</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">n)<br />        puts(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />    </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br />        printf(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">%f\n</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 255);">double</span><span style="color: rgb(0, 0, 0);">(maxl)</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">m);<br />    </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br />}</span></div><br />这道题是03年饶向荣论文里的一道题 有一定难度<br />除了T数组的求解和论文中不同外 没有什么不同<br />论文中说的方法没看懂 期望有牛人能讲一下<br />我的方法很简单就是通过后缀数组完成的 但大大增加了代码长度这好象是我写oi题目写的最长的一道了(我太弱了) 一个不错的开始期望以后每天都能AC并且要多<br /><img src ="http://www.cppblog.com/wwy250/aggbug/79835.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-04-13 23:33 <a href="http://www.cppblog.com/wwy250/archive/2009/04/13/79835.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>100 book  完成＆近期计划</title><link>http://www.cppblog.com/wwy250/archive/2009/04/05/79033.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Sun, 05 Apr 2009 11:09:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/04/05/79033.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/79033.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/04/05/79033.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/79033.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/79033.html</trackback:ping><description><![CDATA[100 book 终于完成了<br />这里的题目难度都非常大 都可以作为NOI的试题 甚至更难<br />其贪心、构造、调整法颇多 还有一些没听说过的 例如差分约束系统、最小限度生成树、区间图判定、最小表示法等等 还涉及到许多数论、几何知识<br />除了前30题 后面的题 有许多都是NP问题 或者说是无法在要去时间内出解的问题 对提交答案式问题去颇帮助<br />其中一些搜索题目的技巧性很高 可以达到一想不到的效果 甚至比某些多项式算法的运行时间还快<br />多说无意毕竟这套资料是以前集训队留下来的 大家说的一定比我强<br /><br />下面3周我将作一些专项训练 大概会使用到WC论文和集训队作业 另外这次的训练要多写代码 逢题必AC(虽然不一定是自己想的) <br /><br />再下面的一周也就是CTSC前的一周我将计时完成以往的CTSC、WC、APIO 从而找到手感迎接即将到来的CTSC、APIO<br /><img src ="http://www.cppblog.com/wwy250/aggbug/79033.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-04-05 19:09 <a href="http://www.cppblog.com/wwy250/archive/2009/04/05/79033.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>100 book若干题总结</title><link>http://www.cppblog.com/wwy250/archive/2009/03/30/78423.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Mon, 30 Mar 2009 15:12:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/30/78423.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/78423.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/30/78423.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/78423.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/78423.html</trackback:ping><description><![CDATA[现在100book进展到25了 还有36道 期望每天4道这样9天之内就能搞完<br />下面对前25道总结一下 在这25道中我学会了<br />差分约束系统<br />限制最小生成树<br />调整法<br />区间图判定<br />最小表示法<br /><br />对构造、贪心有了更进一步的认识<br />还学了一点数论、几何知识<br /><br />另外 我发想 有些题实在不好证明就不要证明 尤其是贪心、构造、调整法 有时候即使是错的也可能又不错的收效<br />要尝试 一个题写多个程序 小数据搜索 大数据写一个不太完善的算法 （当然要是能写出完善的最好）<br />还有我的代码能力实在有待提高<br /><br /><img src ="http://www.cppblog.com/wwy250/aggbug/78423.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-30 23:12 <a href="http://www.cppblog.com/wwy250/archive/2009/03/30/78423.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>找回状态</title><link>http://www.cppblog.com/wwy250/archive/2009/03/30/78357.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Mon, 30 Mar 2009 04:56:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/30/78357.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/78357.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/30/78357.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/78357.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/78357.html</trackback:ping><description><![CDATA[上一周实在很囧<br />我们学校把科技创新等一些杂项都交给了oier  今年科技创新老师又不管 从头到尾都是自己做的 写了一个论文却写成了WC风格的<br />接下来的几天oi的进展都不大 没有状态100book里的每一个题基本都要看解题报告 有的看解题报告都没看懂 除非出原题 要是让我自己做一定做不上 <br />话又说回来这两天看的题都挺偏的 坐不上也有情可原 多见一些没准就会了<br />老师又想让我参加吉大的ACM队 其实我不想去 吉大的ACM很水 而且又不把我分到1队 去了只是提高代码能力(虽然我的代码能力有待提高) 回头再和老师商量一下<br /><br />说了这么都希望能带走不好的状态 下一阶段要全力以赴oi 离CTSC APIO就剩5周了<br />在这5周里 我希望能完成 100book剩下的30+ 以及以往的CTSC WC APIO 要是可能就再看一点集训队作业<br /><img src ="http://www.cppblog.com/wwy250/aggbug/78357.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-30 12:56 <a href="http://www.cppblog.com/wwy250/archive/2009/03/30/78357.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>100book 0017</title><link>http://www.cppblog.com/wwy250/archive/2009/03/21/77369.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Fri, 20 Mar 2009 20:36:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/21/77369.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/77369.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/21/77369.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/77369.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/77369.html</trackback:ping><description><![CDATA[
		<font size="3">一道来自</font>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="ProgId" content="Word.Document" />
		<meta name="Generator" content="Microsoft Word 11" />
		<meta name="Originator" content="Microsoft Word 11" />
		<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" />
		<!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
		<!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]-->
		<style>
				<!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
		</style>
		<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->
		<font size="3">
				<span style="font-size: 12pt; font-family: 宋体;" lang="EN-US">IPSC的题目<br />IPSC这个比赛很有意思 所有题目都是提交答案式的 可惜我英文不好 还要组队<br />有意与我组队请与我联系 我的邮箱：wwy250@gmail.com<br />还有通过这个比赛的排名还是看出中国的教育存在着巨大的问题<br />学生组具有垄断地位 而成人组就不行了<br />言归正传<br />很容易想到的是二分图最大匹配的问题 可以在比赛的时间内跑出来<br />还有一种更优的方法 对于每种S 可以在O(1)时间内接触c<br />对于每一种S:{a1,a2,～～,a(n+1)/2} (a1&lt;a2&lt;～～&lt;a(n+1)/2) c=a((a1+a2+～～+a(n+1)/2)%((n+1)/2)) <br />这个可以用反证法证明：<br /></span>
		</font>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="ProgId" content="Word.Document" />
		<meta name="Generator" content="Microsoft Word 11" />
		<meta name="Originator" content="Microsoft Word 11" />
		<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" />
		<!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
		<!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]-->
		<style>
				<!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
		</style>
		<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->
		<p class="MsoNormal">
				<font size="3">
						<span style="font-family: 宋体; color: black;">若存在两个方案删数后的方案相同，设为</span>
						<span style="color: black;" lang="EN-US">A</span>
						<span style="font-family: 宋体; color: black;">，</span>
						<span style="color: black;" lang="EN-US">B</span>
						<span style="font-family: 宋体; color: black;">（集合），</span>
						<span style="color: black;" lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="3">
						<span style="font-family: 宋体; color: black;">另</span>
						<span style="color: black;" lang="EN-US">a1&lt;a2&lt;</span>
						<span style="font-family: 宋体; color: black;">……</span>
						<span style="color: black;" lang="EN-US">&lt;am,b1&lt;b2&lt;</span>
						<span style="font-family: 宋体; color: black;">……</span>
						<span style="color: black;" lang="EN-US">&lt;bm</span>
						<span style="font-family: 宋体; color: black;">，</span>
						<span style="color: black;" lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="3">
						<span style="font-family: 宋体; color: black;">若</span>
						<span style="color: black;" lang="EN-US">A</span>
						<span style="font-family: 宋体; color: black;">中删去元素</span>
						<span style="color: black;" lang="EN-US">ai</span>
						<span style="font-family: 宋体; color: black;">，</span>
						<span style="color: black;" lang="EN-US">B</span>
						<span style="font-family: 宋体; color: black;">中删去</span>
						<span style="color: black;" lang="EN-US">bj</span>
						<span style="font-family: 宋体; color: black;">，不妨设</span>
						<span style="color: black;" lang="EN-US">i&lt;j</span>
						<span style="font-family: 宋体; color: black;">，显然有</span>
						<span style="color: black;" lang="EN-US">ai&lt;bj<o:p></o:p></span>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="3">
						<span style="font-family: 宋体; color: black;">根据条件，</span>
						<span style="color: black;" lang="EN-US">j-i=(bj-ai) mod m,<o:p></o:p></span>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="3">
						<span style="font-family: 宋体; color: black;">所以</span>
						<span style="color: black;" lang="EN-US">bj</span>
						<span style="font-family: 宋体; color: black;">－</span>
						<span style="color: black;" lang="EN-US">ai</span>
						<span style="font-family: 宋体; color: black;">＝</span>
						<span style="color: black;" lang="EN-US">j-i</span>
						<span style="font-family: 宋体; color: black;">或者</span>
						<span style="color: black;" lang="EN-US">j-i+m<o:p></o:p></span>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="3">
						<span style="color: black;" lang="EN-US">
								<span style=""> </span>
						</span>
						<span style="font-family: 宋体; color: black;">若</span>
						<span style="color: black;" lang="EN-US">bj</span>
						<span style="font-family: 宋体; color: black;">－</span>
						<span style="color: black;" lang="EN-US">ai</span>
						<span style="font-family: 宋体; color: black;">＝</span>
						<span style="color: black;" lang="EN-US">j</span>
						<span style="font-family: 宋体; color: black;">－</span>
						<span style="color: black;" lang="EN-US">i</span>
						<span style="font-family: 宋体; color: black;">，因为</span>
						<span style="color: black;" lang="EN-US">ai+1...aj=bi...bj-1,</span>
						<span style="font-family: 宋体; color: black;">所以</span>
						<span style="color: black;" lang="EN-US">bj-ai-1&gt;=j-i,</span>
						<span style="font-family: 宋体; color: black;">所以不可能</span>
						<span style="color: black;" lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="3">
						<span style="color: black;" lang="EN-US">
								<span style=""> </span>
						</span>
						<span style="font-family: 宋体; color: black;">若</span>
						<span style="color: black;" lang="EN-US">bj</span>
						<span style="font-family: 宋体; color: black;">－</span>
						<span style="color: black;" lang="EN-US">ai</span>
						<span style="font-family: 宋体; color: black;">＝</span>
						<span style="color: black;" lang="EN-US">j</span>
						<span style="font-family: 宋体; color: black;">－</span>
						<span style="color: black;" lang="EN-US">i+m,<o:p></o:p></span>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="3">
						<span style="color: black;" lang="EN-US">
								<span style="">   </span>
						</span>
						<span style="font-family: 宋体; color: black;">因为若</span>
						<span style="color: black;" lang="EN-US">A</span>
						<span style="font-family: 宋体; color: black;">，</span>
						<span style="color: black;" lang="EN-US">B</span>
						<span style="font-family: 宋体; color: black;">存在，则必满足</span>
						<span style="color: black;" lang="EN-US">(m-j)+(i-1)&lt;=(n-bj)+(ai-1)<o:p></o:p></span>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="3">
						<span style="color: black;" lang="EN-US">
								<span style="">   </span>
						</span>
						<span style="font-family: 宋体; color: black;">因为</span>
						<span style="color: black;" lang="EN-US">n</span>
						<span style="font-family: 宋体; color: black;">＝</span>
						<span style="color: black;" lang="EN-US">m</span>
						<span style="font-family: 宋体; color: black;">＋</span>
						<span style="color: black;" lang="EN-US">m-1,</span>
						<span style="font-family: 宋体; color: black;">所以</span>
						<span style="color: black;" lang="EN-US">bj-ai&lt;=j-i+m-1,</span>
						<span style="font-family: 宋体; color: black;">该情况也不能</span>
						<span style="color: black;" lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="3">
						<span style="color: black;" lang="EN-US">
								<o:p> </o:p>
						</span>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="3">
						<span style="font-family: 宋体; color: black;">综上所述，不可能存在两个方案删数后的方案相同。</span>
				</font>
				<span style="color: black;" lang="EN-US">
						<o:p>
						</o:p>
				</span>
		</p>
		<br />
<img src ="http://www.cppblog.com/wwy250/aggbug/77369.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-21 04:36 <a href="http://www.cppblog.com/wwy250/archive/2009/03/21/77369.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>FJOI 06</title><link>http://www.cppblog.com/wwy250/archive/2009/03/17/76822.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Mon, 16 Mar 2009 19:41:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/17/76822.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76822.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/17/76822.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76822.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76822.html</trackback:ping><description><![CDATA[
		<a target="_self" href="/Files/wwy250/NOI2006%E7%A6%8F%E5%BB%BA%E9%80%89%E6%8B%94%E8%B5%9B%E8%AF%95%E5%8D%B7.rar">题目</a>
		<br />第一题是一道数学问题<br />学过数学竞赛的人一定知道对于这个问题<br />分得的所有数一定不是2就是3<br />而且2的个数&lt;3<br />证明如下<br />显然分成含有1的显然不是最优的<br />若含有p(p&gt;3)则可将其分成由2、3的和组成的序列保证其不差于此当前方案<br />第二题 一道维护决策单调性的DP<br />定义f[i][j]在前i个点建j个站前i个点以及建站的费用最小为多上<br />s[i][j] 为f[i][j]的方案<br />显然s[i-1][j]&lt;=s[i][j]&lt;=s[i][j+1]<br />剩下的就不说了<br /><br /><br /><img src ="http://www.cppblog.com/wwy250/aggbug/76822.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-17 03:41 <a href="http://www.cppblog.com/wwy250/archive/2009/03/17/76822.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ZJOI 08 day1</title><link>http://www.cppblog.com/wwy250/archive/2009/03/14/76608.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Sat, 14 Mar 2009 15:21:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/14/76608.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76608.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/14/76608.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76608.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76608.html</trackback:ping><description><![CDATA[
		<a target="_blank" href="/wwy250/articles/76604.html">题目</a>
		<br />这套题做的很囧<br />第一题 题目没什么说的就是模拟 不过很麻烦<br />但是题目里的游戏很好玩 真的很好玩<br />第二题 一开始看像04年 ACM上海赛区的H题 田忌赛马 记得集训队资料里的解法是O(n^2)<br />但是发现 n&lt;=<span style="" lang="EN-US">100000 后来发现这题与田忌赛马是不一样的<br />田忌赛马 是求最大|小分差 那么怎么贪心呢<br />以求最高分为例 提出一个策略：<br />设我方的选手集为A  对方为B<br />若Amax&gt;Bmax<br />则A-=Amax,B-=Bmax  ans+=2<br />否则 A-=Amin,B-=Bmax 如果Amin==Bmax  ans+=1<br />下面是证明<br />若Amax&gt;Bmax<br />假设有一种方案 使得Bmax不与Amax交战&amp;得分&gt;当前方案 <br />设于Bmax、Amax交战的分别为a,b<br />则将Bmax与Amax交战 a与b交战  其余与该方案相同 易证此方案不亚于 该方案&amp;此方案得分=原方案<br />若Amax&lt;=Bmax 同上述方法可证 这里就不多说了<br /><br />值得一说的是第4题 我想了2天 实在没有思路将一些想法记在下面并将它添加到未解决问题中<br />首先想到的是将它想LCA-&gt;RMQ一样搞出一个欧拉序列 通过维护这个序列解题<br />那么借助什么数据结构好呢 线段树？<br />这好像不可能 倒不是得到答案的问题<br />关键是每次更改都要不止更改一个或常数个<br />看来 搞成一个序列是没戏 那么仍保持树状结构呢<br />这回 更改时好办了 但怎么得到答案哪 <br />我又标程 不过我这个人最不擅长就是读程序 但可以看出标程用到平衡树<br />实在是不会 等oibh好了到哪顶上问问应该会有结果</span><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="ProgId" content="PowerPoint.Slide" /><meta name="Generator" content="Microsoft PowerPoint 11" /><!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
p\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
v\:textbox {display:none;}
</style>
<![endif]--><title>幻灯片 20</title><meta name="Description" content="2009-3-14" /><!--[if !ppt]--><style><![CDATA[
.O
	{color:black;
	font-size:149%;}
a:link
	{color:#7E9CE8 !important;}
a:active
	{color:#669999 !important;}
a:visited
	{color:#D8D8EC !important;}
]]&gt;</style><style media="print"><!--.sld
	{left:0px !important;
	width:6.0in !important;
	height:4.5in !important;
	font-size:103% !important;}
--></style><!--[endif]--><o:shapelayout v:ext="edit"></o:shapelayout><o:idmap v:ext="edit" data="1"></o:idmap><p:colorscheme colors="#ffffff,#000000,#808080,#330066,#cccc00,#669999,#7e9ce8,#d8d8ec"></p:colorscheme><p:colorscheme colors="#ffffff,#000000,#808080,#330066,#cccc00,#669999,#7e9ce8,#d8d8ec"></p:colorscheme><img src ="http://www.cppblog.com/wwy250/aggbug/76608.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-14 23:21 <a href="http://www.cppblog.com/wwy250/archive/2009/03/14/76608.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JSOI07 完成情况</title><link>http://www.cppblog.com/wwy250/archive/2009/03/13/76458.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Fri, 13 Mar 2009 07:08:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/13/76458.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76458.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/13/76458.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76458.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76458.html</trackback:ping><description><![CDATA[
		<a target="_blank" href="/wwy250/articles/76436.html">题目</a>
		<br />终于知道JLOI为什么是5题4h了 因为JSOI也是 而JS给JL出题 风格当然一样<br />而且也会有一些比较偏的题目 还有一点是数据弱他还不告诉你 比如最后一题朴素快排就能90分 如果是NOI的会 一定会说90%的数据n&lt;=?的而且不会是90%的 最多是40% 没办法省选又没人赞助谁给你好好出题(好像今年NOI就没有所以WC的题目所有'&lt;='都打成了‘=’)<br />言归正传<br />这套题目好题还是有的<br />比如第一题 虽然我至今没搞明白 但是我知道他要求的是：<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]--><style><!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--></style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]--><font size="4"><span style="font-size: 12pt; font-family: 宋体;">从</span><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;" lang="EN-US">A</span><span style="font-size: 12pt; font-family: 宋体;">中选取最少的点 使得</span><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;" lang="EN-US">B</span><span style="font-size: 12pt; font-family: 宋体;">中所有点都在</span><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;" lang="EN-US">A</span><span style="font-size: 12pt; font-family: 宋体;">中选取点的凸包内  这个变化十分巧妙<br /><font size="3">第二题 枚举和牌和对子是必然的趋势 那么剩下的判断是否为和就只能在线性时间内解决了<br />也就是说题目只给了我们扫一次(或常数次)的机会 而且是能按n扫<br />这么近的时间不得让我们想到贪心 如果对于一张牌 可以组成顺子 也可以组成刻牌 这个时候一定要有一种固定的选择<br />假设选择顺子 很显然若是111234 本来可以和的牌 就不胡了<br />那如果是刻字呢 经反复试验没有找到反例 在时间紧张的比赛中 不一定一定要证明 于是我写了一下<br />AC<br />看来我的感觉还可以 但光靠感觉是不行的 证明如下<br />若经过上诉贪心方法的到的答案是和牌则 这副牌一定是和牌<br />所以只需证明经上述算法得到的答案为非和时 这副牌一定非和 下面的证明均在</font></span></font><font size="4"><span style="font-size: 12pt; font-family: 宋体;"><font size="3">经上述算法得到的答案为非和前提下进行<br />假设有一种方案能使这副牌和<br />则一定有至少一处 原方案为刻字而新方案为顺子<br />将每个组合按最小、较小、最大3个关键字顺次按有小到大排序<br />找到第一次这样的地方<br />显然之前的牌组合的方式两种方案是一样的<br />所以当将原方案中的刻字转化为顺子后 如果该方案为和牌则另两张在原方案为刻字的牌也与其后面两张组成顺子 与组成3个刻字等效 所以假设不成立(这样和在我们吉林打法还大呢)<br />第3题 我认为是一道比较偏的题目 看了解题报告仍觉得比较偏<br />一个被逼无奈的贪心 结果竟是AC 在这里我不想多说了 有兴趣的同学看<a target="_blank" href="/wwy250/articles/76437.html">这里</a>吧 <br />第4题 比较常见的DP 好像在URAL上做过 就是搞一个f[i][j]表示前i个字符 后缀为前缀j(这里的j只在我们预先搞好的trie里的编号)不含有可识别单词的个数 重点维护f 总之很麻烦 但好想 我就不想说了(我的表达能力容易把自己说糊涂了)<br />第5题 赤裸裸的后缀数组 只要将原串加倍即可 我的倍增可以AC而解题报告说这么做会超时 是不是他用string了 不超时才怪呢<br /></font></span></font><font size="4"><span style="font-size: 12pt; font-family: 宋体;"></span></font><img src ="http://www.cppblog.com/wwy250/aggbug/76458.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-13 15:08 <a href="http://www.cppblog.com/wwy250/archive/2009/03/13/76458.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JSOI01 完成情况</title><link>http://www.cppblog.com/wwy250/archive/2009/03/12/76378.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Thu, 12 Mar 2009 14:54:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/12/76378.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76378.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/12/76378.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76378.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76378.html</trackback:ping><description><![CDATA[
		<a target="_blank" href="/wwy250/articles/76376.html">题目</a>
		<br />由于是01年的题目<br />难度自然比较低<br />前3题都是搜索/模拟题 在这里就不多累述<br />第4题一开始被他数据小的特点蒙骗了<br />搜索|状态压缩的DP 好像都不行 一时间没了头绪<br />后来想到了二分图 其实早应该想到二分图<br />以横向为例 显然对于每一条线段 如果线段上没有"墙" 则线段上对多只能有1个车<br />纵向同理<br />所以先遍历一次这个矩形 求出所有上述线段 以及所有非墙格子所在的横纵线段<br />将所有有相交的线段之间连一条边 求二分图最大匹配即可<br />对于某些所求为XX最多 每个XX影响两个元素的题目 二分图往往能够起到作用<br /><img src ="http://www.cppblog.com/wwy250/aggbug/76378.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-12 22:54 <a href="http://www.cppblog.com/wwy250/archive/2009/03/12/76378.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JLOI 告一段落</title><link>http://www.cppblog.com/wwy250/archive/2009/03/12/76292.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Wed, 11 Mar 2009 19:26:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/12/76292.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76292.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/12/76292.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76292.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76292.html</trackback:ping><description><![CDATA[RT<br />明天做江苏不过江苏我只有两届的题<br />但是是江苏给我们出省选试题 不做不行<br />各位游客如有江苏试题希望能共享资源<br /><img src ="http://www.cppblog.com/wwy250/aggbug/76292.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-12 03:26 <a href="http://www.cppblog.com/wwy250/archive/2009/03/12/76292.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JL08 棋局定式 解题报告</title><link>http://www.cppblog.com/wwy250/archive/2009/03/12/76291.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Wed, 11 Mar 2009 19:21:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/12/76291.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76291.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/12/76291.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76291.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76291.html</trackback:ping><description><![CDATA[
		<a href="/wwy250/articles/76171.html">题目</a>
		<br />对于这到题目很容易看出是一个多字符串匹配问题 显然是要用到trie图<br />不过这个题目要求将所有定式 一次trie恐怕是做不了了<br />难道要用其他的方法么 虽然单纯的trie无法满足题目要求 但是没有比他再像的了<br />继续思考trie图可以完成的事将所有匹配成功的位置以及与谁匹配返回<br />但是每个匹配成功的位置只能返回一个 与其成功匹配的字符串 显然这会有遗漏<br />比如<br />dd<br />bbdd<br />去匹配bbdd则最多只会有一个被记录<br />显然如果一个两个串需要同时被记录当且仅当一个串是另一个串的后缀并且较长串被匹配<br />所以每次记录长度最长的字符串即可<br />在这次匹配之后建一颗trie将所有字符串的逆串插入<br />查找所有被记录的字符串将路径上所有的字符串记录即可<br /><img src ="http://www.cppblog.com/wwy250/aggbug/76291.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-12 03:21 <a href="http://www.cppblog.com/wwy250/archive/2009/03/12/76291.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JLOI总结</title><link>http://www.cppblog.com/wwy250/archive/2009/03/11/76170.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Tue, 10 Mar 2009 19:43:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/11/76170.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76170.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/11/76170.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76170.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76170.html</trackback:ping><description><![CDATA[02&amp;03年的题目没什么意思 基本都是模拟|搜索题 就不为它们单写一篇文章了如果你对<a target="_self" href="/Files/wwy250/JLOI02,03.rar">题目</a>有兴趣就看一下吧<br />其实JLOI的题目不怎么好 题目不是简单就是偏 好题很少 但我毕竟是JL人 JLOI还是要做的<br />连续做了7年的JLOI 从中看出了JLOI的成长 这一点让我很欣慰 毕竟整体水平的提高会带动个人的提高 这叫做水涨船高<br />但是不得不说JLOI的导向不好 水题多&amp;时间少<br />强烈建议加大难度 改成two day 5h3题 这样才像NOI<br />以前的省选只要拿到基础分就可以进省队了 这个导向很不好 应该让真正能做上难题的人进才对<br />不过做在不好的题目也会有收获 下面是我的收获：<br />08 05 ：通过这到题从新认识了一下AC自动机 原来他不是向treap一样只要写对了就没事了<br />他有一些变化 所以我决定 明天看一下《多串匹配算法及其启示》《Trie图的构建、活用与改进》<br />05 03 ：知道了二分图最小点覆盖这个模型<br />另外还有了一些骗分、那部分分的心得 只可意会不可言传<br />另外由于时间关系08 04、06 03没有好好研究一下明天同一研究<br /><br /><br /><br /><img src ="http://www.cppblog.com/wwy250/aggbug/76170.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-11 03:43 <a href="http://www.cppblog.com/wwy250/archive/2009/03/11/76170.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>我未解决的问题</title><link>http://www.cppblog.com/wwy250/archive/2009/03/11/76168.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Tue, 10 Mar 2009 18:19:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/11/76168.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76168.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/11/76168.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76168.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76168.html</trackback:ping><description><![CDATA[
		<font size="3">这片文章被长期置顶 内容是从此帖发布以来我一直不能解决&amp;值得研究的问题 每当我遇到不会的问题或解决了其中的某个问题都会更新它 期望大家能帮助我解 等那天得空把以前积累下来的问题也发上来</font>
		<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" />
		<!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
		<!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]-->
		<style>
				<!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:黑体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimHei;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:1 135135232 16 0 262144 0;}
@font-face
	{font-family:华文中宋;
	mso-font-alt:Dotum;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:647 135200768 16 0 262303 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:"\@黑体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:1 135135232 16 0 262144 0;}
@font-face
	{font-family:"\@华文中宋";
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:647 135200768 16 0 262303 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
	{margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:none;
	tab-stops:center 207.65pt right 415.3pt;
	layout-grid-mode:char;
	font-size:9.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:42.55pt;
	mso-footer-margin:49.6pt;
	border:solid windowtext 1.0pt;
	mso-border-alt:solid windowtext .5pt;
	padding:24.0pt 24.0pt 24.0pt 24.0pt;
	mso-paper-source:0;
	layout-grid:15.6pt;}
div.Section1
	{page:Section1;}
-->
		</style>
		<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->
		<p class="MsoNormal" style="text-indent: 10.5pt;">
				<font size="3">
						<span style="font-family: 宋体;">
								<span lang="EN-US">
										<o:p>
										</o:p>
								</span>
						</span>
				</font>
		</p>
		<!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
		<!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]-->
		<style>
				<!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:黑体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimHei;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:1 135135232 16 0 262144 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:"\@黑体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:1 135135232 16 0 262144 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
		</style>
		<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->
		<font size="3">
				<a target="_blank" href="/wwy250/articles/76216.html">
						<b style="">
								<span style="font-size: 15pt; font-family: 黑体;">
								</span>
						</b>
				</a>
		</font>
		<!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]-->
		<style>
				<!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:黑体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimHei;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:1 135135232 16 0 262144 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:"\@黑体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:1 135135232 16 0 262144 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
		</style>
		<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->
		<font size="3">
				<b>
						<span style="font-size: 10.5pt; font-family: &quot;Times New Roman&quot;;">
								<span style="">
								</span>
						</span>
						<font size="4">
								<a href="/wwy250/articles/76218.html">
										<span style="font-size: 15pt; font-family: 黑体;">运动会</span>
								</a>
						</font>
				</b>
		</font>
		<p class="MsoNormal">
				<font size="3">虽然拿到了满分 但是那是因为数据若 我用的是先想解决2—SAT问题贪心一个解在随机化搜索的方法</font>
		</p>
		<p class="MsoNormal">
				<font size="3">这个题有没有多项式算法？</font>
		</p>
		<p class="MsoNormal">
				<font size="4">
						<b>
								<a href="/wwy250/articles/76220.html">
										<span style="font-size: 15pt; font-family: 黑体;">双调路径</span>
								</a>
						</b>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="3">没看懂题题目中的"好"/"佳"没搞明白什么意思</font>
		</p>
		<p class="MsoNormal">
				<font size="3">但感觉应该是一道值得一做的题目</font> </p>
		<p class="MsoNormal">
				<b>
						<font size="4">块状链表</font>
				</b>
		</p>
		<p class="MsoNormal">这个大概思想知道 有没有一个向讲treap一样详细的资料把他的具体实现方式以及所有的功能诠释</p>
		<p class="MsoNormal">
				<font size="4">
						<b>最小费用流 的负环情况的的处理方法 <br /></b>
				</font>
		</p>
		<p class="MsoNormal">
				<b>
						<font size="4">二维凸包</font> </b>
		</p>
		<p class="MsoNormal">
				<br />
		</p>
		<p class="MsoNormal">
				<font size="4">
						<b style="">
								<span style="font-size: 16pt; font-family: 宋体;">
										<a target="_blank" href="/wwy250/articles/76438.html">合金</a>
										<br />
								</span>
						</b>
						<a target="_blank" href="/wwy250/articles/76437.html">
								<b style="">
										<span style="font-size: 16pt; font-family: 宋体;">建筑抢修</span>
								</b>
						</a>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="4">上面两个题我都有解题报告不幸的是没看懂 大家可以去看看 看看会不会有什么启示</font>
				<br />
				<font size="4">
						<b>
								<a target="_blank" href="/wwy250/articles/76171.html">
										<span style="font-size: 15pt; font-family: 黑体;">
										</span>
								</a>
						</b>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="4">
						<b>
								<br />
								<a target="_blank" href="/wwy250/articles/76171.html">
										<span style="font-size: 15pt; font-family: 黑体;">
										</span>
								</a>
						</b>
				</font>
		</p>
		<p class="MsoNormal">
				<font size="4">
						<b>
								<br />
								<a target="_blank" href="/wwy250/articles/76171.html">
										<span style="font-size: 15pt; font-family: 黑体;">
										</span>
								</a>
						</b>
				</font>
		</p>
		<p class="MsoNormal">
				<br />
				<a target="_blank" href="/wwy250/articles/76171.html">
						<b style="">
								<span style="font-size: 15pt; font-family: 黑体;">
								</span>
						</b>
				</a>
		</p>
		<p class="MsoNormal">
				<br />
				<a target="_blank" href="/wwy250/articles/76171.html">
						<b style="">
								<span style="font-size: 15pt; font-family: 黑体;">
								</span>
						</b>
				</a>
		</p>
		<p class="MsoNormal">
				<br />
				<a target="_blank" href="/wwy250/articles/76171.html">
						<b style="">
								<span style="font-size: 15pt; font-family: 黑体;">
								</span>
						</b>
				</a>
		</p>
		<p class="MsoNormal">
				<br />
				<a target="_blank" href="/wwy250/articles/76171.html">
						<b style="">
								<span style="font-size: 15pt; font-family: 黑体;">
								</span>
						</b>
				</a>
		</p>
		<p class="MsoNormal">
				<br />
				<a target="_blank" href="/wwy250/articles/76171.html">
						<b style="">
								<span style="font-size: 15pt; font-family: 黑体;">
								</span>
						</b>
				</a>
		</p>
<img src ="http://www.cppblog.com/wwy250/aggbug/76168.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-11 02:19 <a href="http://www.cppblog.com/wwy250/archive/2009/03/11/76168.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oibh.org/bbs 挂了？</title><link>http://www.cppblog.com/wwy250/archive/2009/03/11/76166.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Tue, 10 Mar 2009 17:58:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/11/76166.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76166.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/11/76166.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76166.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76166.html</trackback:ping><description><![CDATA[oibh.org/bbs 上不去了 这是怎么回事<br />经OIBH管理人员证实确实挂了<br /><img src ="http://www.cppblog.com/wwy250/aggbug/76166.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-11 01:58 <a href="http://www.cppblog.com/wwy250/archive/2009/03/11/76166.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JLOI04完成情况</title><link>http://www.cppblog.com/wwy250/archive/2009/03/11/76164.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Tue, 10 Mar 2009 17:10:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/11/76164.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76164.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/11/76164.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76164.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76164.html</trackback:ping><description><![CDATA[
		<a target="_self" href="/Files/wwy250/JLOI04.rar">题目</a>
		<br />越往前做题目就越简单了 而且只有4道<br />通过省选试题难度的变化 看来JLOI这几年确实进步了不少<br />这次的题目全都做上了<br />第一题是一道数学题 在这里就不多说了<br />第二题他让你求的是一个点(x,y)使得sigema(wi*((x-xi)^2+(y-yi)^2))(1&lt;=i&lt;=n 以下同此)最小 <br />初看这个式子里又有x 又有 y 很复杂不好权衡<br />可是乘法是符合结合率的<br />所以原式=sigema(wi*(x-xi)^2)+sigema(wi*(y-yi)^2)<br />所以当sigema(wi*(x-xi)^2)、sigema(wi*(y-yi)^2)都取道最小时既为所求<br />则就好办了就是一个带权平均数问题(这个好像有学名不过忘了)<br />以x为例x=sigema(wi*xi)/sigema(xi) y同理<br />第3题：<br />如果枚举任意2个为c的方块然再bfs或并查集找最长曲线显然是要超时的(O((n*m)^3)，1&lt;=n,m&lt;=30)<br />发现由于只改动两个方块而每次都求一边最长曲线会造成许多重复运算 <br />如果现将整个矩阵先用并查集做一遍然后枚举该边哪两个为c的方块再算最长曲线就可以在常数时间内完成最长曲线的求解<br />如果你总是觉得用什么不对劲的地方 没关系(其实我一开始也是这样的)<br />我还有一种人那你放心的方法：先枚举一个c然后做一次并查集然后再枚举另一个c再用并查集求解 这回不乱了吧(能合并的最多有2条曲线) 这个方法只是将常数增大了 而让算法清晰了 不失为一种不错的选择<br />第4题<br />想了好久差点放弃了 因为只想到了O((n+m)*(n*m)^2)的算法<br />但后来一看1&lt;=n,m&lt;=10这个时间复杂度是绰绰有余的<br />显然任意一个被切下来的矩形都与其他矩形再无干系 这就使得这个模型没有后效性<br />提到后效性不由得让我们想到DP<br />状态为f[x1][y1][x2][y2]表示把左上角为(x1,y1) 右下角为(x2,y2)的矩形分割成题目中要求的形态最少需要的切割长度 转移只需要枚举切割线就好了<br /><img src ="http://www.cppblog.com/wwy250/aggbug/76164.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-11 01:10 <a href="http://www.cppblog.com/wwy250/archive/2009/03/11/76164.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JLOI05完成情况</title><link>http://www.cppblog.com/wwy250/archive/2009/03/10/76134.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Tue, 10 Mar 2009 09:41:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/10/76134.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76134.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/10/76134.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76134.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76134.html</trackback:ping><description><![CDATA[
		<a target="_self" href="/Files/wwy250/JLOI05.rar">题目</a>
		<br />这套题之前没有做过 不过还是没有NOI什么也做不上的感觉<br />1、2、4题居然全是DP<br />分别是以当前位置+路径长度、以当前节点为根结点的子树+使用机器数、当前节点+当前时间为状态<br />其中2题的状态转移又是一次DP 方法类似背包问题<br />第5题 我只想到了m*n*logn^2的算法：枚举m通过二分+树状数组查找下一步的位置 虽然不能AC但打表还是可以的(最大的点用时13s)<br />后来在OIBH上看到了一个n^m的解法：枚举m 将问题划归成长度为n-（被删除的城市个数）北京的位置随之改变 这样既可以忽略被删除的城市<br />特别注意m不应定&lt;=n<br />第3题 这道题总数后点收获 二分图最小点覆盖问题 可惜我从来没听说过 现在听说也不晚如果你还没听说过就去看看这个吧：http://www.matrix67.com/blog/archives/116<br />现在看来很简单了 搞n+m各点表示每行/列 读入01矩阵 若该点是1则将所在行与所在列连一条边<br />剩下的工作就是求二分图最小点覆盖了 也就是它的最大匹配<br /><img src ="http://www.cppblog.com/wwy250/aggbug/76134.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-10 17:41 <a href="http://www.cppblog.com/wwy250/archive/2009/03/10/76134.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JLOI06完成情况</title><link>http://www.cppblog.com/wwy250/archive/2009/03/09/76052.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Mon, 09 Mar 2009 15:48:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/09/76052.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76052.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/09/76052.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76052.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76052.html</trackback:ping><description><![CDATA[
		<a target="_self" href="/Files/wwy250/JLOI06.rar">题目</a>
		<br />我发现做虽然我是JL人但是做JLOI很没有意义原因在于简单&amp;题目偏&amp;我很多都做过<br />这样好了 我就不限时做了 把认为在比赛中应该做的写出来好了<br />这套题好象是170+就能进省队 不过那是当年 现在300怎么也可以了吧<br />显然2、4是可以拿200分的<br />那下一个100该怎么拿呢<br />由于第3题叙述不清+我的文学水平较差所以我没看懂题<br />第5题我同样没看懂<br />可是第1题用2—SAT的方法初始化+随机化搜索居然拿到了满分 真是天无绝人之路<br /><br /><img src ="http://www.cppblog.com/wwy250/aggbug/76052.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-09 23:48 <a href="http://www.cppblog.com/wwy250/archive/2009/03/09/76052.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JLOI07完成情况</title><link>http://www.cppblog.com/wwy250/archive/2009/03/09/76043.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Mon, 09 Mar 2009 15:00:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/09/76043.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76043.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/09/76043.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76043.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76043.html</trackback:ping><description><![CDATA[
		<a target="_self" title="JLOI07" href="/Files/wwy250/JLOI07.rar">题目</a>
		<br />由于这套题很简单并且做过就没有一一去做只是把不会的做了一下<br />1：模拟<br />2：加分二叉树<br />3：枚举<br />4：数学题 维护一种平衡<br />当年AC的程序如下：<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">#include</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">fstream</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);"> std;<br /><br />ifstream cin(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">smiley.in</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />ofstream cout(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">smiley.out</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /><br /></span><span style="color: rgb(0, 0, 255);">double</span><span style="color: rgb(0, 0, 0);"> y64(</span><span style="color: rgb(0, 0, 255);">double</span><span style="color: rgb(0, 0, 0);"> k)<br />{<br />    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(k</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">64</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> k;<br />    </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> y64(k</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">64</span><span style="color: rgb(0, 0, 0);">);<br />}<br /><br /></span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> main()<br />{<br />    </span><span style="color: rgb(0, 0, 255);">double</span><span style="color: rgb(0, 0, 0);"> i,n,m;<br />    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> ans;<br />    cin</span><span style="color: rgb(0, 0, 0);">&gt;&gt;</span><span style="color: rgb(0, 0, 0);">m</span><span style="color: rgb(0, 0, 0);">&gt;&gt;</span><span style="color: rgb(0, 0, 0);">n;<br />    ans</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br />    i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">y64(n</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">m);<br />    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">((</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">i)</span><span style="color: rgb(0, 0, 0);">&amp;&amp;</span><span style="color: rgb(0, 0, 0);">(i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">))ans</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br />    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">((</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">i)</span><span style="color: rgb(0, 0, 0);">&amp;&amp;</span><span style="color: rgb(0, 0, 0);">(i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);">))ans</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">;<br />    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">((</span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">i)</span><span style="color: rgb(0, 0, 0);">&amp;&amp;</span><span style="color: rgb(0, 0, 0);">(i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">8</span><span style="color: rgb(0, 0, 0);">))ans</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);">;<br />    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">((</span><span style="color: rgb(0, 0, 0);">8</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">i)</span><span style="color: rgb(0, 0, 0);">&amp;&amp;</span><span style="color: rgb(0, 0, 0);">(i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">16</span><span style="color: rgb(0, 0, 0);">))ans</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">8</span><span style="color: rgb(0, 0, 0);">;<br />    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">((</span><span style="color: rgb(0, 0, 0);">16</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">i)</span><span style="color: rgb(0, 0, 0);">&amp;&amp;</span><span style="color: rgb(0, 0, 0);">(i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">32</span><span style="color: rgb(0, 0, 0);">))ans</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">16</span><span style="color: rgb(0, 0, 0);">;<br />    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">32</span><span style="color: rgb(0, 0, 0);">&lt;=</span><span style="color: rgb(0, 0, 0);">i)ans</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">32</span><span style="color: rgb(0, 0, 0);">;<br />    cout</span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);">ans;<br />    </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br />}</span></div>5.唯一的有一定难度的题<br />其实也不难<br />搞一个小根堆<br />队中的元素为一些线段 维护向这个线段注水从开始到溢出的时间 要求每个线段的左端挡板与右端挡板均为线段中最高的<br />每次取根结点将它与它将溢出方向上的第一个线段合并 直至该线段为最左或最又的线段<br /><img src ="http://www.cppblog.com/wwy250/aggbug/76043.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-09 23:00 <a href="http://www.cppblog.com/wwy250/archive/2009/03/09/76043.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JLOI08完成情况</title><link>http://www.cppblog.com/wwy250/archive/2009/03/09/76033.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Mon, 09 Mar 2009 14:09:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/09/76033.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/76033.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/09/76033.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/76033.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/76033.html</trackback:ping><description><![CDATA[题目链接：http://www.cppblog.com/Files/wwy250/problemset.rar<br />得分 364 用时 4h<br />由于做过分高一点<br />1.模拟没什么说的 得分100<br />2.动态规划 得分100<br />令f[c][l]=为匹配部分为字符串c的前缀l使得后面的字符串有<font size="3">两种分解方法的最小长度<br />这句话说的我自己都听不</font><font size="3">懂请大家结合下图看</font><font size="3"><br /><img src="http://www.cppblog.com/images/cppblog_com/wwy250/9756/o_JL08%20codes.bmp" alt="o_JL08 codes.bmp" width="376" border="0" height="184" /><br />所以答案即为min(f[i][0]|1&lt;=i&lt;=n)<br />转移方程为：f[c][l]=min(min(getf(i,strlen(s[c])-l)+l|后缀l+1为i的子    串),min(getf(c,l+strlen(s[i]))|i为后缀l+1的子串))<br />至于输出方案就不用我说了吧<br />3.按N皇后搜的 得分30<br />4.贪心+随机化+卡时 得分54<br />每次对于能直接拓展的每个节点有一个权值既通过该节点可直接拓展的节点数×一个随机数（0&lt;rand()&lt;1）<br />从小到大一次拓展全职由小到大的节点+上一个卡时就是这个分数<br />5.</font><font size="3">KMP做的</font><font size="3"> 得分80分<br />想到 AC自动机可是我只能判断字符串集里是否有棋局的子串 而如可将所有子串求出无从下手<br /></font><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]--><style><!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--></style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]--><font size="2"><span style="font-size: 10.5pt; font-family: 宋体;"></span></font><img src ="http://www.cppblog.com/wwy250/aggbug/76033.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-09 22:09 <a href="http://www.cppblog.com/wwy250/archive/2009/03/09/76033.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>线段树&amp;DP</title><link>http://www.cppblog.com/wwy250/archive/2009/03/09/75952.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Sun, 08 Mar 2009 20:09:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/09/75952.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/75952.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/09/75952.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/75952.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/75952.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 放出在“至NOI 09有做的事情”里提到的线段树&DP<br>由于这是我很长时间以前做的事了<br>所以只放出我搜索到的资料（大部分看了 还有一些没看懂）<br>这是1月前我写给自己看的 所以很乱  好多都是我硬盘里的地址<br>大家就将就着看吧<br>&nbsp;&nbsp;<a href='http://www.cppblog.com/wwy250/archive/2009/03/09/75952.html'>阅读全文</a><img src ="http://www.cppblog.com/wwy250/aggbug/75952.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-09 04:09 <a href="http://www.cppblog.com/wwy250/archive/2009/03/09/75952.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>基础代码</title><link>http://www.cppblog.com/wwy250/archive/2009/03/09/75951.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Sun, 08 Mar 2009 19:57:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/09/75951.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/75951.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/09/75951.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/75951.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/75951.html</trackback:ping><description><![CDATA[放出在&#8220;至NOI 09有做的事情&#8221;里提到的基础代码<br>http://www.cppblog.com/Files/wwy250/%E5%9F%BA%E7%A1%80%E4%BB%A3%E7%A0%81.rar<br>由于以后还有机会用到就没有一一测试<br>但思路一定是正确的<br>如果发现错误期望提出<br>里面 trie图错了<br>这样就对了<br>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><img id="Code_Closed_Image_215448" onclick="this.style.display='none'; code_closed_text_215448.style.display="'none';" code_open_image_215448.style.display="'inline';" code_open_text_215448.style.display="'inline';"" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedBlock.gif" width="11" align="top" height="16"><img id="Code_Open_Image_215448" style="display: none;" onclick="this.style.display='none'; code_open_text_215448.style.display="'none';" code_closed_image_215448.style.display="'inline';" code_closed_text_215448.style.display="'inline';"" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top" height="16"><span id="Code_Closed_Text_215448" style="border: 1px solid #808080; background-color: #ffffff;"></span><span id="Code_Open_Text_215448" style="display: none;"><br><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #000000;">#include</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">iostream</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"><br><br></span><span style="color: #0000ff;">using</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">namespace</span><span style="color: #000000;">&nbsp;std;<br><br></span><span style="color: #0000ff;">struct</span><span style="color: #000000;">&nbsp;node<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">bool</span><span style="color: #000000;">&nbsp;match;<br>&nbsp;&nbsp;&nbsp;&nbsp;node&nbsp;</span><span style="color: #000000;">*</span><span style="color: #000000;">faild,</span><span style="color: #000000;">*</span><span style="color: #000000;">chaild[</span><span style="color: #000000;">26</span><span style="color: #000000;">];<br>}</span><span style="color: #000000;">*</span><span style="color: #000000;">trie</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;">&nbsp;node(),</span><span style="color: #000000;">*</span><span style="color: #000000;">super</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;">&nbsp;node(),</span><span style="color: #000000;">*</span><span style="color: #000000;">q[</span><span style="color: #000000;">100000</span><span style="color: #000000;">];<br></span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;h,l;<br><br></span><span style="color: #0000ff;">void</span><span style="color: #000000;">&nbsp;insert(node&nbsp;</span><span style="color: #000000;">*</span><span style="color: #000000;">t,</span><span style="color: #0000ff;">char</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">*</span><span style="color: #000000;">c)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #000000;">!*</span><span style="color: #000000;">c)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">match</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">return</span><span style="color: #000000;">&nbsp;;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #000000;">!</span><span style="color: #000000;">t</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[</span><span style="color: #000000;">*</span><span style="color: #000000;">c</span><span style="color: #000000;">-</span><span style="color: #000000;">'</span><span style="color: #000000;">a</span><span style="color: #000000;">'</span><span style="color: #000000;">])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[</span><span style="color: #000000;">*</span><span style="color: #000000;">c</span><span style="color: #000000;">-</span><span style="color: #000000;">'</span><span style="color: #000000;">a</span><span style="color: #000000;">'</span><span style="color: #000000;">]</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;">&nbsp;node();<br>&nbsp;&nbsp;&nbsp;&nbsp;insert(t</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[</span><span style="color: #000000;">*</span><span style="color: #000000;">c</span><span style="color: #000000;">-</span><span style="color: #000000;">'</span><span style="color: #000000;">a</span><span style="color: #000000;">'</span><span style="color: #000000;">],c</span><span style="color: #000000;">+</span><span style="color: #000000;">1</span><span style="color: #000000;">);&nbsp;&nbsp;&nbsp;&nbsp;<br>}<br><br></span><span style="color: #0000ff;">void</span><span style="color: #000000;">&nbsp;build()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">26</span><span style="color: #000000;">;</span><span style="color: #000000;">++</span><span style="color: #000000;">i)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i]</span><span style="color: #000000;">=</span><span style="color: #000000;">trie;<br>&nbsp;&nbsp;&nbsp;&nbsp;trie</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">faild</span><span style="color: #000000;">=</span><span style="color: #000000;">super;<br>&nbsp;&nbsp;&nbsp;&nbsp;q[l</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">=</span><span style="color: #000000;">trie;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">for</span><span style="color: #000000;">(;h</span><span style="color: #000000;">++!=</span><span style="color: #000000;">l;)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;node&nbsp;</span><span style="color: #000000;">*</span><span style="color: #000000;">p</span><span style="color: #000000;">=</span><span style="color: #000000;">q[h];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">26</span><span style="color: #000000;">;</span><span style="color: #000000;">++</span><span style="color: #000000;">i)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i]</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">faild</span><span style="color: #000000;">=</span><span style="color: #000000;">p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">faild</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i]</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">match</span><span style="color: #000000;">|=</span><span style="color: #000000;">p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i]</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">faild</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">match;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q[</span><span style="color: #000000;">++</span><span style="color: #000000;">l]</span><span style="color: #000000;">=</span><span style="color: #000000;">p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">else</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i]</span><span style="color: #000000;">=</span><span style="color: #000000;">p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">faild</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i];<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br><br></span><span style="color: #0000ff;">char</span><span style="color: #000000;">&nbsp;c[</span><span style="color: #000000;">1000</span><span style="color: #000000;">];<br><br></span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;match(node&nbsp;</span><span style="color: #000000;">*</span><span style="color: #000000;">t,</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;th)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(t</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">match)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout</span><span style="color: #000000;">&lt;&lt;</span><span style="color: #000000;">th</span><span style="color: #000000;">&lt;&lt;</span><span style="color: #000000;">endl;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #000000;">!</span><span style="color: #000000;">c[th])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">return</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">0</span><span style="color: #000000;">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">return</span><span style="color: #000000;">&nbsp;match(t</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[c[th]</span><span style="color: #000000;">-</span><span style="color: #000000;">'</span><span style="color: #000000;">a</span><span style="color: #000000;">'</span><span style="color: #000000;">],th</span><span style="color: #000000;">+</span><span style="color: #000000;">1</span><span style="color: #000000;">);<br>}</span></span></div>
<br>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #000000;">#include</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">iostream</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"><br><br></span><span style="color: #0000ff;">using</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">namespace</span><span style="color: #000000;">&nbsp;std;<br><br></span><span style="color: #0000ff;">struct</span><span style="color: #000000;">&nbsp;node<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">bool</span><span style="color: #000000;">&nbsp;match;<br>&nbsp;&nbsp;&nbsp;&nbsp;node&nbsp;</span><span style="color: #000000;">*</span><span style="color: #000000;">faild,</span><span style="color: #000000;">*</span><span style="color: #000000;">chaild[</span><span style="color: #000000;">26</span><span style="color: #000000;">];<br>}</span><span style="color: #000000;">*</span><span style="color: #000000;">trie</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;">&nbsp;node(),</span><span style="color: #000000;">*</span><span style="color: #000000;">super</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;">&nbsp;node(),</span><span style="color: #000000;">*</span><span style="color: #000000;">q[</span><span style="color: #000000;">100000</span><span style="color: #000000;">];<br></span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;h,l;<br><br></span><span style="color: #0000ff;">void</span><span style="color: #000000;">&nbsp;insert(node&nbsp;</span><span style="color: #000000;">*</span><span style="color: #000000;">t,</span><span style="color: #0000ff;">char</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">*</span><span style="color: #000000;">c)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #000000;">!*</span><span style="color: #000000;">c)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">match</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">return</span><span style="color: #000000;">&nbsp;;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #000000;">!</span><span style="color: #000000;">t</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[</span><span style="color: #000000;">*</span><span style="color: #000000;">c</span><span style="color: #000000;">-</span><span style="color: #000000;">'</span><span style="color: #000000;">a</span><span style="color: #000000;">'</span><span style="color: #000000;">])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[</span><span style="color: #000000;">*</span><span style="color: #000000;">c</span><span style="color: #000000;">-</span><span style="color: #000000;">'</span><span style="color: #000000;">a</span><span style="color: #000000;">'</span><span style="color: #000000;">]</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;">&nbsp;node();<br>&nbsp;&nbsp;&nbsp;&nbsp;insert(t</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[</span><span style="color: #000000;">*</span><span style="color: #000000;">c</span><span style="color: #000000;">-</span><span style="color: #000000;">'</span><span style="color: #000000;">a</span><span style="color: #000000;">'</span><span style="color: #000000;">],c</span><span style="color: #000000;">+</span><span style="color: #000000;">1</span><span style="color: #000000;">);&nbsp;&nbsp;&nbsp;&nbsp;<br>}<br><br></span><span style="color: #0000ff;">void</span><span style="color: #000000;">&nbsp;build()<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">26</span><span style="color: #000000;">;</span><span style="color: #000000;">++</span><span style="color: #000000;">i)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i]</span><span style="color: #000000;">=</span><span style="color: #000000;">trie;<br>&nbsp;&nbsp;&nbsp;&nbsp;trie</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">faild</span><span style="color: #000000;">=</span><span style="color: #000000;">super;<br>&nbsp;&nbsp;&nbsp;&nbsp;q[l</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">=</span><span style="color: #000000;">trie;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">for</span><span style="color: #000000;">(;h</span><span style="color: #000000;">++!=</span><span style="color: #000000;">l;)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;node&nbsp;</span><span style="color: #000000;">*</span><span style="color: #000000;">p</span><span style="color: #000000;">=</span><span style="color: #000000;">q[h];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">26</span><span style="color: #000000;">;</span><span style="color: #000000;">++</span><span style="color: #000000;">i)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i]</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">faild</span><span style="color: #000000;">=</span><span style="color: #000000;">p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">faild</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i]</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">match</span><span style="color: #000000;">|=</span><span style="color: #000000;">p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i]</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">faild</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">match;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q[</span><span style="color: #000000;">++</span><span style="color: #000000;">l]</span><span style="color: #000000;">=</span><span style="color: #000000;">p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">else</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i]</span><span style="color: #000000;">=</span><span style="color: #000000;">p</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">faild</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[i];<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br><br></span><span style="color: #0000ff;">char</span><span style="color: #000000;">&nbsp;c[</span><span style="color: #000000;">1000</span><span style="color: #000000;">];<br><br></span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;match(node&nbsp;</span><span style="color: #000000;">*</span><span style="color: #000000;">t,</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;th)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(t</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">match)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout</span><span style="color: #000000;">&lt;&lt;</span><span style="color: #000000;">th</span><span style="color: #000000;">&lt;&lt;</span><span style="color: #000000;">endl;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #000000;">!</span><span style="color: #000000;">c[th])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">return</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">0</span><span style="color: #000000;">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">return</span><span style="color: #000000;">&nbsp;match(t</span><span style="color: #000000;">-&gt;</span><span style="color: #000000;">chaild[c[th]</span><span style="color: #000000;">-</span><span style="color: #000000;">'</span><span style="color: #000000;">a</span><span style="color: #000000;">'</span><span style="color: #000000;">],th</span><span style="color: #000000;">+</span><span style="color: #000000;">1</span><span style="color: #000000;">);<br>}</span></div>
树状数组里ask的变量名打错了<br>正确的应是
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #000000;">#include</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">iostream</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"><br></span><span style="color: #0000ff;">#define</span><span style="color: #000000;">&nbsp;lowbit(x)&nbsp;((x)&amp;(-(x)))</span><span style="color: #000000;"><br><br></span><span style="color: #0000ff;">using</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">namespace</span><span style="color: #000000;">&nbsp;std;<br><br></span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;c[</span><span style="color: #000000;">1000001</span><span style="color: #000000;">],n;<br><br>inline&nbsp;</span><span style="color: #0000ff;">void</span><span style="color: #000000;">&nbsp;add(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;p,</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;v)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;i</span><span style="color: #000000;">=</span><span style="color: #000000;">p;i</span><span style="color: #000000;">&lt;=</span><span style="color: #000000;">n;i</span><span style="color: #000000;">+=</span><span style="color: #000000;">lowbit(i))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c[i]</span><span style="color: #000000;">+=</span><span style="color: #000000;">v;<br>}<br><br>inline&nbsp;</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;ask(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;p)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;r</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;i</span><span style="color: #000000;">=</span><span style="color: #000000;">p;i</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;">-=</span><span style="color: #000000;">lowbit(i))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r</span><span style="color: #000000;">+=</span><span style="color: #000000;">c[i];<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">return</span><span style="color: #000000;">&nbsp;r;<br>}</span></div>
<br> <img src ="http://www.cppblog.com/wwy250/aggbug/75951.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-09 03:57 <a href="http://www.cppblog.com/wwy250/archive/2009/03/09/75951.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>至NOI 09要做的事</title><link>http://www.cppblog.com/wwy250/archive/2009/03/09/75950.html</link><dc:creator>250</dc:creator><author>250</author><pubDate>Sun, 08 Mar 2009 19:48:00 GMT</pubDate><guid>http://www.cppblog.com/wwy250/archive/2009/03/09/75950.html</guid><wfw:comment>http://www.cppblog.com/wwy250/comments/75950.html</wfw:comment><comments>http://www.cppblog.com/wwy250/archive/2009/03/09/75950.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/wwy250/comments/commentRss/75950.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wwy250/services/trackbacks/75950.html</trackback:ping><description><![CDATA[
		<font color="#ccff00">
				<font color="#99ff00">
						<b style="color: rgb(106, 168, 79);">
								<font size="3">
										<span style="font-family: ms song,monospace;">
										</span>
										<span style="font-family: ms song,monospace;">
										</span>
								</font>
						</b>
				</font>
				<font color="#00cc00">
						<b>后缀数组<br />网络流&amp;二分图</b>
				</font>
		</font>
		<font color="#00cc00">
				<b>
						<br />线段树<br />DP</b>
		</font>
		<br />
		<hr size="2" width="100%" />
		<b>
				<font color="#00cc00">基础代码:treap、树状数组（1、2维）、后缀数组、有/无（上下界的）（费用）最大流、强联通分量、kmp、AC自动机、LCA——RMQ、heep+dis、</font>
		</b>
		<font color="#000000">块状链表</font>
		<b>
				<font color="#00cc00">、高斯消元、leftheap+topsort+欧拉路</font>
		</b>+<b><font color="#00cc00">以前写过的</font></b><br /><hr size="2" width="100%" />3h内不看答案  最后写出来  每天3个题（可用<font color="#000000">基础代码</font>）<br />100book<br />
论文<br />
集训队作业<br />
sgu<br />
ctsc<br />
wc<br />预计用时：14week<hr size="2" width="100%" />熟练<font color="#000000">基础代码</font><br />预计用时：1week<hr size="2" width="100%" />第一遍 ：做题——每题记时做 4h内 记录通过调试过样例时间、通过初步测试时间、通过对拍时间 并分别保存测试记录<br />第二遍 ：非AC 每题记录 通过调试过样例时间、通过初步测试时间 并分别保存测试记录（时间×1.5，得分×70%）<br />第三遍 ：看解题报告<br />每天2个题<br />制定NOI2009方案<br />noi（不可用<font color="#000000">基础代码</font>）<br />预计用时：4week<hr size="2" width="100%" />强化线段树、dp&amp;调整作息时间<br />预计用时：1week<br /><br />我会在完成每项后放出所用到的资料名称以及我的原创资料 最前面已经是一个月之前的事了我放不了那么全了<br />注释：绿色为已完成<br /><img src ="http://www.cppblog.com/wwy250/aggbug/75950.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wwy250/" target="_blank">250</a> 2009-03-09 03:48 <a href="http://www.cppblog.com/wwy250/archive/2009/03/09/75950.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>