﻿<?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++博客-The Sun Also Rises-随笔分类-ACM/ICPC</title><link>http://www.cppblog.com/FreePeter/category/6171.html</link><description>Algorithm, Mathematica, 计算机科学, C++, photography, Linux的讨论空间</description><language>zh-cn</language><lastBuildDate>Mon, 19 May 2008 12:27:51 GMT</lastBuildDate><pubDate>Mon, 19 May 2008 12:27:51 GMT</pubDate><ttl>60</ttl><item><title>[Retrospect] Andrew Stankevich's Contest</title><link>http://www.cppblog.com/FreePeter/archive/2008/05/01/48607.html</link><dc:creator>FreePeter</dc:creator><author>FreePeter</author><pubDate>Thu, 01 May 2008 12:45:00 GMT</pubDate><guid>http://www.cppblog.com/FreePeter/archive/2008/05/01/48607.html</guid><wfw:comment>http://www.cppblog.com/FreePeter/comments/48607.html</wfw:comment><comments>http://www.cppblog.com/FreePeter/archive/2008/05/01/48607.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/FreePeter/comments/commentRss/48607.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/FreePeter/services/trackbacks/48607.html</trackback:ping><description><![CDATA[                  Retrospect only, some algorithms may be wrong...<br id="cyo30">
Warning : 剧透慎入...<br id="cyo31">
<br id="cyo32">
<strong id="cyo33">Andrew Stankevich's Contest #1</strong><br id="cyo34" style="font-weight: bold;">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2313" id="cyo35">Chinese Girls' Amusement</a><br id="cyo36">
推结论直接算<br id="cyo37">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2314" id="cyo38">Reactor Cooling</a><br id="cyo39">
有上下界的环形流<br id="cyo310">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2315" id="cyo311">New Year Bonus Grant</a><br id="cyo312">
经典的树形DP<br id="cyo313">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2316" id="cyo314">Matrix Multiplication</a><br id="cyo315">
化简一下推结论<br id="cyo316">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2317" id="cyo317">Nice Patterns Strike Back</a>&nbsp; (Recommend)<br id="cyo318">
状态压缩DP后用matrix来优化，或者用上次monthly时LK的方法。<br id="cyo319">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2318" id="cyo320">Get Out!</a> (Recommend)<br id="cyo321">
可以用那个生成环的基的DFS,类似japan那道题。<br id="cyo322">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2319" id="cyo323">Beautiful People</a><br id="cyo324">
最长虾米序列，8过稍微有个细节要想<br id="cyo325">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2320" id="cyo326">Cracking' RSA</a> (Recommend)<br id="cyo327">
求bool方程组的解数。。。也就是求下自由变量个数<br id="cyo328">
<br id="cyo329">
<br id="cyo330">
<strong id="cyo331">Andrew Stankevich's Contest #2<br id="cyo332">
</strong><a  href="http://acm.zju.edu.cn/show_problem.php?pid=2337" id="cyo333">Non Absorbing DFA</a><br id="cyo334">
记得是个很正常的DP。<br id="cyo335">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2338" id="cyo336">The Towers of Hanoi Revisited</a><br id="cyo337">
经典的n个塔的hanoi，记得要DP...<br id="cyo338">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2339" id="cyo339">Hyperhuffman</a><br id="cyo340">
就是huffman问题吧，已经排好序，可以O(n)的。<br id="cyo341">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2340" id="cyo342">Little Jumper</a> (Recommend)<br id="cyo343">
不错的物理题<br id="cyo344">
首先可以想象成两只青蛙一起从两边跳。<br id="cyo345">
主要问题就是计算给定一个v后的青蛙可达区间。<br id="cyo346">
取到最值只有3种情况：从上面擦过，从下面擦过，45度起跳（如果可以）<br id="cyo347">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2341" id="cyo348">Quantization Problem</a><br id="cyo349">
又是一个正常的DP...<br id="cyo350">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2342" id="cyo351">Roads</a><br id="cyo352">
经典问题了。<br id="cyo353">
生成树上的权值必定是减少，其他边上的权值必定增大，设其分别为ai, bj<br id="cyo354">
然后对任意一条不在生成树上的边，加入到生成树上形成一个环，然后这条边的权值应当&gt;=环上所有边的权值。<br id="cyo355">
然后我们可以列出一堆形如ai + bj &gt;= 一个正数的不等式。。。然后。。。km算法的标顶~~~<br id="cyo356">
详情可以看km算法的证明~~~<br id="cyo357">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2343" id="cyo358">Robbers</a><br id="cyo359">
首先令k[i] = m * x[i] / y，取下整，然后可能k[i]的和不到m，要增加一些k[i]，当然是，每次找增大后delta最小的~~~<br id="cyo360">
主要是，似乎可以用heap优化为O(nlogn)。。。<br id="cyo361">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2344" id="cyo362">Toral Tickets</a> (Recommended)<br id="cyo363">
比较神奇的Polya<br id="cyo364">
<br id="cyo365">
<strong id="cyo366">Andrew Stankevich's Contest #3<br id="cyo367">
</strong><a  href="http://acm.zju.edu.cn/show_problem.php?pid=2361" id="cyo368">Areas</a> (Recommended)<br id="cyo369">
我的做法是基于半平面交的，对每条直线，枚举使用它左边的半平面还是右边的半平面，最后如果是一个有限平面则返回。。。<br id="cyo370">注意搜索过程中当半平面被切空后就可以return，由于最后只有O(n^2)块，所以复杂度是O(n^4)的（使用O(n^2)的半平面交）<br id="cyo371">SGU上时限很宽，ZJU上这么做时间有点紧（我0.95s AC的-_-bbbbbbb）<br id="cyo372">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2362" id="cyo373">Beloved Sons</a><br id="cyo374">
按偏爱程度从大到小找增广路跑max_match就可以了。。。<br id="cyo375">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2363" id="cyo376">Strange Counter</a><br id="cyo377">
构造<br id="cyo378">
维护这么一个性质两个2之间至少有一个0。。。然后。。。讨论。。。<br id="cyo379">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2364" id="cyo380">Data Transmission</a> (In List)<br id="cyo381">
据说是预流 + 使劲优化...(by Lunarmony)<br id="cyo382">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2365" id="cyo383">Strong Defence</a><br id="cyo384">
嗯，首先颜色数不会超过任何一条路的长度是把。。。所以颜色数至多就是最短路的长度。<br id="cyo385">
然后我们跑dijstra的时候把边着上颜色就是了。。。<br id="cyo386">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2366" id="cyo387">Weird Dissimilarity</a><br id="cyo388">
经典的DP<br id="cyo389">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2367" id="cyo390">PL/Cool</a><br id="cyo391">
据说是模拟(from oibh)。。。<br id="cyo392">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2368" id="cyo393">Royal Federation</a> (In List)<br id="cyo394">
据说是构造, not AC yet.<br id="cyo395">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2369" id="cyo396">Two Cylinders</a><br id="cyo397">
写出积分式后romberg.<br id="cyo398">
<br id="cyo399">
<strong id="cyo3100">Andrew Stankevich's Contest #4<br id="cyo3101">
</strong><a  href="http://acm.zju.edu.cn/show_problem.php?pid=2559" id="cyo3102">The Smart Bomb</a><br id="cyo3103">
简单的推一下。<br id="cyo3104">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2560" id="cyo3105">I Just Called ...</a><br id="cyo3106">
模拟，要用Trie树。<br id="cyo3107">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2561" id="cyo3108">Order-Preserving Codes</a><br id="cyo3109">
模仿huffman那样，只是每次merge相邻的。<br id="cyo3110">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2562" id="cyo3111">More Divisors</a><br id="cyo3112">
经典的DP, f[i][j]用前i个素数得到j个约数的最小数。。。<br id="cyo3113">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2563" id="cyo3114">Long Dominoes</a><br id="cyo3115">
状态压缩DP<br id="cyo3116">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2564" id="cyo3117">The Magic Wheel</a><br id="cyo3118">
应该选择第一个点，然后寻找下一层的两个方向最近的都试一下就行了。O(N)<br id="cyo3119">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2565" id="cyo3120">Cracking SSH</a><br id="cyo3121">
DP...<br id="cyo3122">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2566" id="cyo3123">Periodic Tilings</a><br id="cyo3124">
好像某年final有类似的题。应该有结论的说。<br id="cyo3125">
Not AC yet<br id="cyo3126">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2567" id="cyo3127">Trade</a> (In List)<br id="cyo3128">
Not AC yet, 可以看看<br id="cyo3129">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2568" id="cyo3130">Counting Triangulations</a> (Recommended)<br id="cyo3131">
一道还算不错的DP题，8过题目描述好像有点不清我记得。<br id="cyo3132">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2569" id="cyo3133">Unfair Contest</a><br id="cyo3134">
搜索+模拟<br id="cyo3135">
<br id="cyo3136">
<br id="cyo3137">
<strong id="cyo3138">Andrew Stankevich's Contest #5</strong><br id="cyo3139" style="font-weight: bold;">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2587" id="cyo3140">Unique Attack</a> (Recommended)<br id="cyo3141">
判断最小割是否唯一的题，就是用两种方法构造是否一样。<br id="cyo3142">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2588" id="cyo3143">Burning Bridges</a><br id="cyo3144">
ms是很经典的用桥来作的题<br id="cyo3145">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2589" id="cyo3146">Circles</a><br id="cyo3147">
经典的平面图欧拉公式题<br id="cyo3148">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2590" id="cyo3149">Linear Programming Dual</a><br id="cyo3150">
好象是线性规划，Not AC yet<br id="cyo3151">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2591" id="cyo3152">DVD</a> (In List)<br id="cyo3153">
相当容易写错的DP题。<br id="cyo3154">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2592" id="cyo3155">Think Positive</a><br id="cyo3156">
记得可以O(n)扫描的。<br id="cyo3157">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2593" id="cyo3158">Ranking</a><br id="cyo3159">
麻烦的模拟题。<br id="cyo3160">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2594" id="cyo3161">Driving Straight</a><br id="cyo3162">
也是很经典的思路了，先DP(或曰BFS)。然后走一遍，在满足有解的前提下尽量往那个方向走。<br id="cyo3163">
<br id="cyo3164">
<strong id="cyo3165">Andrew Stankevich's Contest #6<br id="cyo3166">
</strong><a  href="http://acm.zju.edu.cn/show_problem.php?pid=2595" id="cyo3167">Ackerman's Function</a> (Recommended)<br id="cyo3168">
可以认为是找规律<br id="cyo3169">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2596" id="cyo3170">The Minimal Angle</a><br id="cyo3171">
记得要O(n)，取平均数还是什么都可以。<br id="cyo3172">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2597" id="cyo3173">Yellow Code</a><br id="cyo3174">
我记得还是比较容易YY一个构造的。。。<br id="cyo3175">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2598" id="cyo3176">Yet Another Digit</a><br id="cyo3177">
DP吧。<br id="cyo3178">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2599" id="cyo3179">Graduated Lexicographical Ordering</a> (In List)<br id="cyo3180">
类似于vietnam的那道题。。。相当麻烦。。。建议实现下。。。<br id="cyo3181">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2600" id="cyo3182">GSM</a><br id="cyo3183">
高精度开方题。或者打表～<br id="cyo3184">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2601" id="cyo3185">Warehouse Keeper</a> (In List)<br id="cyo3186">
KM,8过我记得容易T?<br id="cyo3187">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2602" id="cyo3188">Don't Go Left</a><br id="cyo3189">
记得又是一个状态机的BFS题<br id="cyo3190">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2603" id="cyo3191">Railroad Sort</a><br id="cyo3192">
很有意思的构造，大体思路是每经过一个station，留住后一半，放行前一半。。。n个正好给2^n个数排序。<br id="cyo3193">
<br id="cyo3194">
<strong id="cyo3195">Andrew Stankevich's Contest #7</strong><br id="cyo3196" style="font-weight: bold;">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2604" id="cyo3197">Little Brackets</a><br id="cyo3198">
经典的dp, NOI陨石的秘密简化版。。。<br id="cyo3199">
f[n][k] = n对括号，&lt;=k层<br id="cyo3200">
f[n][k] = sigma(f[m][k] * f[n - m - 1][k - 1])，输出f[n][k] - f[n][k - 1]<br id="cyo3201">
就是每次添加一整个括号块。<br id="cyo3202">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2605" id="cyo3203">Under Control</a> (In List)<br id="cyo3204">
转换坐标离散化吧<br id="cyo3205">
类似思路有道超级复杂版<a  href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3248" id="cyo3206">Soldier</a><br id="cyo3207">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2606" id="cyo3208">Holidays</a> (In List)<br id="cyo3209">Not AC Yet<br id="cyo3210">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2607" id="cyo3211">Laboratory</a><br id="cyo3212">
记得列出式子调整下就行了。时限吓人的～<br id="cyo3213">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2608" id="cyo3214">Maps</a><br id="cyo3215">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2609" id="cyo3216">Crazy Painter</a><br id="cyo3217">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2610" id="cyo3218">Puzzle</a><br id="cyo3219">
没记错的话BFS一下吧。。。<br id="cyo3220">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2611" id="cyo3221">Quest</a><br id="cyo3222">
经典的状态压缩BFS，输方案有点麻烦。。。<br id="cyo3223">
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2612" id="cyo3224">Stable Sets</a><br id="cyo3225">
<br id="cyo3226">
<br id="cyo3227">
<br id="cyo3228">
<br id="cyo3229" style="font-weight: bold;"><img src ="http://www.cppblog.com/FreePeter/aggbug/48607.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/FreePeter/" target="_blank">FreePeter</a> 2008-05-01 20:45 <a href="http://www.cppblog.com/FreePeter/archive/2008/05/01/48607.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[Solution] Japan 2007</title><link>http://www.cppblog.com/FreePeter/archive/2008/05/01/48606.html</link><dc:creator>FreePeter</dc:creator><author>FreePeter</author><pubDate>Thu, 01 May 2008 12:25:00 GMT</pubDate><guid>http://www.cppblog.com/FreePeter/archive/2008/05/01/48606.html</guid><wfw:comment>http://www.cppblog.com/FreePeter/comments/48606.html</wfw:comment><comments>http://www.cppblog.com/FreePeter/archive/2008/05/01/48606.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/FreePeter/comments/commentRss/48606.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/FreePeter/services/trackbacks/48606.html</trackback:ping><description><![CDATA[            [Solution] Tokyo 2007<br id="vzoi0"><br id="vzoi1">And Then There Was One<br id="vzoi2">经典题，递推。<br id="vzoi3"><br id="vzoi4">Prime Gap<br id="vzoi5">简单题<br id="vzoi6"><br id="vzoi7">Minimal Backgammon<br id="vzoi8">DP<br id="vzoi9"><br id="vzoi10">Lowest Pyramid<br id="vzoi11">比较麻烦的题目，大体做法是枚举一个点，根据距离相等可以枚举另一个点（这些点很少了），然后确定下最后一个点，check.<br id="vzoi12"><br id="vzoi13">Geometric Map<br id="vzoi14">比较麻烦的预处理 + dijstra <br id="vzoi15"><br id="vzoi16">Slim Span<br id="vzoi17">经典问题了，按边大小排序，每次加一条边，如果形成环去掉环上最小的边。check<br id="vzoi18"><br id="vzoi19">The Morning after Halloween<br id="vzoi20">BFS，最后用A*过掉的。用max(当前位置到目标位置)估价<br id="vzoi21"><br id="vzoi22">Bug Hunt<br id="vzoi23">简单模拟<br id="vzoi24"><br id="vzoi25">Most Distant Point from the Sea<br id="vzoi26">可以用二分＋半平面交。<br id="vzoi27">但也可以想象所有边朝里面挤压，这样最后要么是两条边压到一起，要么三条边压成一个点。O(n^3)枚举。<br id="vzoi28"><br id="vzoi29">The Teacher's Side of Math<br id="vzoi30">注意到p,q都是质数，所以答案是0必须是所有其他项系数全为0，这样就可以解方程了。<br id="vzoi31">用long double + 最大主元法可以过。<br id="vzoi32"><br id="vzoi33">      <img src ="http://www.cppblog.com/FreePeter/aggbug/48606.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/FreePeter/" target="_blank">FreePeter</a> 2008-05-01 20:25 <a href="http://www.cppblog.com/FreePeter/archive/2008/05/01/48606.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[Solution] SWERC 2007 Southwestern Europe</title><link>http://www.cppblog.com/FreePeter/archive/2008/05/01/48605.html</link><dc:creator>FreePeter</dc:creator><author>FreePeter</author><pubDate>Thu, 01 May 2008 12:24:00 GMT</pubDate><guid>http://www.cppblog.com/FreePeter/archive/2008/05/01/48605.html</guid><wfw:comment>http://www.cppblog.com/FreePeter/comments/48605.html</wfw:comment><comments>http://www.cppblog.com/FreePeter/archive/2008/05/01/48605.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/FreePeter/comments/commentRss/48605.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/FreePeter/services/trackbacks/48605.html</trackback:ping><description><![CDATA[            [Solution] SWERC 2007 Southwestern Europe<br id="s_1y0">比较简单，有些题读题比较郁闷。<br id="s_1y1"><br id="s_1y2"><a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=3981" id="s_1y3" class="g">BEATBIT</a><br id="s_1y4">两DFA是否同构，bfs or 判断树是否同构都可以（因为保证了可以终止所以没有环存在）<br id="s_1y5"><br id="s_1y6"><a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=3982" id="s_1y7" class="g">Prester John</a><br id="s_1y8">题意没说清，走路的方式类似于NFA, BFS就行了。<br id="s_1y9">不过可以出个数据让所有程序T...<br id="s_1y10"><br id="s_1y11"><a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=3983" id="s_1y12" class="g">Robotruck</a><br id="s_1y13">O(N*C)的DP<br id="s_1y14"><br id="s_1y15"><a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=3984" id="s_1y16" class="g">Jumping Hero</a><br id="s_1y17">BFS，最多300 * 300 * 5000 * 5种状态，当然实际上远远不到。<br id="s_1y18"><br id="s_1y19"><a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=3985" id="s_1y20" class="g">Board Game</a><br id="s_1y21">Bellman-Ford<br id="s_1y22"><br id="s_1y23"><a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=3986" id="s_1y24" class="g">The Bridges of Kolsberg</a><br id="s_1y25">经典DP<br id="s_1y26"><br id="s_1y27"><a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=3987" id="s_1y28" class="g">The Finest Chef</a><br id="s_1y29">最优权匹配<br id="s_1y30"><br id="s_1y31"><a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=3988" id="s_1y32" class="g">IP-TV</a><br id="s_1y33">MST<br id="s_1y34"><br id="s_1y35"><a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=3989" id="s_1y36" class="g">Ladies' Choice</a><br id="s_1y37">稳定婚姻<br id="s_1y38"><img src ="http://www.cppblog.com/FreePeter/aggbug/48605.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/FreePeter/" target="_blank">FreePeter</a> 2008-05-01 20:24 <a href="http://www.cppblog.com/FreePeter/archive/2008/05/01/48605.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[Solution] Dhaka 2007</title><link>http://www.cppblog.com/FreePeter/archive/2008/05/01/48604.html</link><dc:creator>FreePeter</dc:creator><author>FreePeter</author><pubDate>Thu, 01 May 2008 12:22:00 GMT</pubDate><guid>http://www.cppblog.com/FreePeter/archive/2008/05/01/48604.html</guid><wfw:comment>http://www.cppblog.com/FreePeter/comments/48604.html</wfw:comment><comments>http://www.cppblog.com/FreePeter/archive/2008/05/01/48604.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/FreePeter/comments/commentRss/48604.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/FreePeter/services/trackbacks/48604.html</trackback:ping><description><![CDATA[<p class="MsoNormal"><span lang="EN-US">[Solution] Dhaka 2007<br>
<br>
<a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=4055">Bachelor
Arithmetic</a><br>
</span><span style="font-family: 宋体;">秒杀题</span><span lang="EN-US"><br>
<br>
<a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=4056">Nested
Squares</a><br>
</span><span style="font-family: 宋体;">模拟题</span><span lang="EN-US"><br>
<br>
<a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=4057">The
Dumb Grocer</a><br>
</span><span style="font-family: 宋体;">首先要有</span><span lang="EN-US">1</span><span style="font-family: 宋体;">是吧。。。然后我们按照</span><span lang="EN-US">1</span><span style="font-family: 宋体;">的个数来分类，我们来计算恰有</span><span lang="EN-US">k</span><span style="font-family: 宋体;">个</span><span lang="EN-US">1</span><span style="font-family: 宋体;">的方案数。</span><span lang="EN-US"><br>
</span><span style="font-family: 宋体;">我们在</span><span lang="EN-US">k</span><span style="font-family: 宋体;">个</span><span lang="EN-US">1</span><span style="font-family: 宋体;">的基础上加入新的数，显然第一个数只能是</span><span lang="EN-US">k+1<br>
</span><span style="font-family: 宋体;">然后加入的数只能是</span><span lang="EN-US">k + 1
or 2 * (k + 1)<br>
</span><span style="font-family: 宋体;">如法炮制。。。发现非</span><span lang="EN-US">1</span><span style="font-family: 宋体;">的数都具有</span><span lang="EN-US">(k + 1) * t</span><span style="font-family: 宋体;">的形式。。。设其依次为</span><span lang="EN-US">(k + 1) * ti<br>
</span><span style="font-family: 宋体;">则</span><span lang="EN-US">{ti}</span><span style="font-family: 宋体;">这些数也满足题目的性质。。。共有</span><span lang="EN-US">f((n - k) / (k + 1))</span><span style="font-family: 宋体;">种方案。</span><span lang="EN-US"><br>
<br>
</span><span style="font-family: 宋体;">设</span><span lang="EN-US">f(n)</span><span style="font-family: 宋体;">是要求的函数，则</span><span lang="EN-US">f(n) = sigma(f((n - k) / (k
+ 1)), (k + 1) | (n + 1) , k&gt;=<st1:chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="1" unitname="F" w:st="on">1<br>
</st1:chmetcnv>f(0) = 1<br>
</span><span style="font-family: 宋体;">这样直接做会</span><span lang="EN-US">T...<br>
</span><span style="font-family: 宋体;">我们令</span><span lang="EN-US">g(n) = f(n
- 1)<br>
</span><span style="font-family: 宋体;">则</span><span lang="EN-US">g(n) = f(n -
1) = sigma(f((n - k - 1) / (k + 1))) = sigma(f(n / (k + 1) - 1)) = sigma(g(n /
(k + 1)), (k + 1) | n, k &gt;= 1<br>
</span><span style="font-family: 宋体;">设</span><span lang="EN-US">n = p1^a1 *
p2^a2 * ... * pr*ar<br>
</span><span style="font-family: 宋体;">令</span><span lang="EN-US">h(p1, p2,..,
pr, a1, a2...ar) = g(n)<br>
= h(p1,p2, ...pr, b1, b2, ...br), <br>
0&lt;=bi &lt;= ai, bi</span><span style="font-family: 宋体;">不全</span><span lang="EN-US">=ai<br>
</span><span style="font-family: 宋体;">注意对于一个确定的</span><span lang="EN-US">n</span><span style="font-family: 宋体;">，</span><span lang="EN-US">h()</span><span style="font-family: 宋体;">中的</span><span lang="EN-US">p1, p2...pr</span><span style="font-family: 宋体;">在计算过程中始终不变。。。所以。。。<strong>计算结果与</strong></span><strong><span lang="EN-US">pi</span></strong><strong><span style="font-family: 宋体;">无关</span><span lang="EN-US">,</span></strong><strong><span style="font-family: 宋体;">只与</span><span lang="EN-US">ai</span></strong><strong><span style="font-family: 宋体;">有关</span></strong><span lang="EN-US"><br>
</span><span style="font-family: 宋体;">这样状态数就大大减少了。。。直接因式分解后</span><span lang="EN-US">dp</span><span style="font-family: 宋体;">就行了。。。</span><span lang="EN-US"><br>
<br>
<a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=4058">ACM
Puzzles</a><br>
</span><span style="font-family: 宋体;">状态压缩</span><span lang="EN-US">dp</span></p>
<p class="MsoNormal"><span lang="EN-US"><br>
<a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=4059">Inspector's
Dilemma</a></span><span style="font-family: 宋体;">、</span><span lang="EN-US"><a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=4060">The
Bells are Ringing</a></span><span style="font-family: 宋体;">、</span> <span lang="EN-US"><a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=4061">Photographic
Tour</a><br>
</span><span style="font-family: 宋体;">这三题好像当时没写</span><span lang="EN-US">summary</span><span style="font-family: 宋体;">。。。所以我们假设比较简单～～～</span></p>
<p class="MsoNormal"><span lang="EN-US"><br>
<a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=4062">You
are around me ...</a><br>
</span><span style="font-family: 宋体;">首先旋转坐标，变成平行与</span><span lang="EN-US">xy</span><span style="font-family: 宋体;">轴的椭圆，然后坐标伸缩。。。变成圆。。。最近点对。。。贴模板。。。</span><span lang="EN-US"><br>
<a  href="http://acm.zju.edu.cn/show_problem.php?pid=2107">ZJU2107 Quoit Design</a>
</span><span style="font-family: 宋体;">一道测最近点对的题。</span></p>
<p class="MsoNormal"><span lang="EN-US"><br>
<a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=4063">Infinite
Matrix</a><br>
</span><span style="font-family: 宋体;">显然，对于固定的</span><span lang="EN-US">j, Ri,
j</span><span style="font-family: 宋体;">是一个关于</span><span lang="EN-US">i</span><span style="font-family: 宋体;">的多项式。</span><span lang="EN-US"><br>
</span><span style="font-family: 宋体;">注意到数列</span><span lang="EN-US">Ri, j</span><span style="font-family: 宋体;">的差分序列</span><span lang="EN-US">R(i + 1, j) - R(i, j)</span><span style="font-family: 宋体;">是可以求出来的（利用</span><span lang="EN-US">Mj, k &lt;= 10</span><span style="font-family: 宋体;">的条件，可以在</span><span lang="EN-US">O(10*n^2)</span><span style="font-family: 宋体;">的时间内算出）</span><span lang="EN-US"><br>
</span><span style="font-family: 宋体;">然后有了差分序列求通项就是</span><span lang="EN-US">O(n^2)</span><span style="font-family: 宋体;">的事情。</span><span lang="EN-US"><br>
</span><span style="font-family: 宋体;">然后记</span><span lang="EN-US">S(p, j)(n)
= Sigma(i^p * R(i, j)) i &lt;= n<br>
</span><span style="font-family: 宋体;">继续利用差分序列之类的方法求这个，最后再求一个</span><span lang="EN-US">Sum_S(p, j)<br>
</span><span style="font-family: 宋体;">预处理复杂度大致是</span><span lang="EN-US">O(10*n^3)</span><span style="font-family: 宋体;">的。</span><span lang="EN-US"><br>
</span><span style="font-family: 宋体;">后面的就好办了，对每个询问，把</span><span lang="EN-US">(i + 1)^p</span><span style="font-family: 宋体;">二项式展开，最多</span><span lang="EN-US">10</span><span style="font-family: 宋体;">项，然后利用公式直接计算。</span><span lang="EN-US"><br>
</span><span style="font-family: 宋体;">处理询问复杂度</span><span lang="EN-US">O(p*q*n)<br>
POJ3529 <a  href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3529">Matrix
Analysis</a></span><span style="font-family: 宋体;">，类似的思想，更简单～</span><span lang="EN-US"><br>
<br>
<a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=4064">Magnetic
Train Tracks</a><br>
</span><span style="font-family: 宋体;">给定</span><span lang="EN-US">n</span><span style="font-family: 宋体;">个点，求可以构成多少个锐角三角形。</span><span lang="EN-US"><br>
n &lt;= 1200<br>
</span><span style="font-family: 宋体;">话说求锐角三角形不太好算是吧。。。补集转换，我们来求钝角</span><span lang="EN-US">/</span><span style="font-family: 宋体;">直角三角形</span><span lang="EN-US">
&lt;=&gt; </span><span style="font-family: 宋体;">求钝角</span><span lang="EN-US">/</span><span style="font-family: 宋体;">直角个数。。。</span><span lang="EN-US"><br>
</span><span style="font-family: 宋体;">后面的事情就简单了，是对每个点，将其他点按照极角排序</span><span lang="EN-US"> + </span><span style="font-family: 宋体;">扫描。</span><span lang="EN-US"><br>
<a  href="http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=3295">Dhaka
2005 Counting Triangles</a> </span><span style="font-family: 宋体;">也是一道补集转换的题～（转化成求三点共线的个数）</span><span lang="EN-US"><br>
<a  href="http://acm.pku.edu.cn/JudgeOnline/problem?id=2280">Shanghai 2004
Amphiphilic Carbon Molecules</a> </span><span style="font-family: 宋体;">也是一道极角排序</span><span lang="EN-US">+</span><span style="font-family: 宋体;">扫描的题。</span><span lang="EN-US"><br>
<!--[if !supportLineBreakNewLine]--><br>
<!--[endif]--></span></p><img src ="http://www.cppblog.com/FreePeter/aggbug/48604.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/FreePeter/" target="_blank">FreePeter</a> 2008-05-01 20:22 <a href="http://www.cppblog.com/FreePeter/archive/2008/05/01/48604.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>World Final 2008, Peter’s Perceptive, 流水帐版</title><link>http://www.cppblog.com/FreePeter/archive/2008/04/11/46843.html</link><dc:creator>FreePeter</dc:creator><author>FreePeter</author><pubDate>Fri, 11 Apr 2008 08:03:00 GMT</pubDate><guid>http://www.cppblog.com/FreePeter/archive/2008/04/11/46843.html</guid><wfw:comment>http://www.cppblog.com/FreePeter/comments/46843.html</wfw:comment><comments>http://www.cppblog.com/FreePeter/archive/2008/04/11/46843.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cppblog.com/FreePeter/comments/commentRss/46843.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/FreePeter/services/trackbacks/46843.html</trackback:ping><description><![CDATA[<p class="MsoNormal"><span style="font-family: 宋体;">这个是流水帐。。。</span><span lang="EN-US">comment</span><span style="font-family: 宋体;">我晚些时候写。。。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">World Final 2008, Peter&#8217;s Perceptive</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">虽然大家似乎都没有受到</span><span lang="EN-US">banff</span><span style="font-family: 宋体;">海拔的影响，但我确实感受到了（可能是我体质比较敏感）。简单点说就是我如果跑步之类的话过一会会感到头晕。反正那两天在宾馆训练的时候一开始做题完全处于一塌糊涂</span><span lang="EN-US">+</span><span style="font-family: 宋体;">什么错误都能犯的状态（虽然有部分时差的因素）。后来就刻意降低速度，基本上用平原上</span><span lang="EN-US">80%</span><span style="font-family: 宋体;">的速度还是没什么问题的。。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">早上起来，开始贯彻前一天计划好的食谱，</span><span lang="EN-US">2</span><span style="font-family: 宋体;">块全麦面包</span><span lang="EN-US"> + bacon
+ </span><span style="font-family: 宋体;">橙汁</span> <span lang="EN-US">+ </span><span style="font-family: 宋体;">巧克力。。。话说吃多了会影响比赛状态是吧。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">比赛开始</span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">我开始看的</span><span lang="EN-US">A</span><span style="font-family: 宋体;">不是直接可以写的。</span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">大约</span><span lang="EN-US">20</span><span style="font-family: 宋体;">分钟</span><span lang="EN-US">Lunar</span><span style="font-family: 宋体;">告诉我</span><span lang="EN-US">JK</span><span style="font-family: 宋体;">都可写，大体感觉对</span><span lang="EN-US">K</span><span style="font-family: 宋体;">把握更大。开写（这时候</span><span lang="EN-US">30</span><span style="font-family: 宋体;">分钟么？我忘了）。。。当时看</span><span lang="EN-US">board</span><span style="font-family: 宋体;">，第一</span><span lang="EN-US">seems</span><span style="font-family: 宋体;">已经</span><span lang="EN-US">2</span><span style="font-family: 宋体;">个题了。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">K</span><span style="font-family: 宋体;">总体感觉写的不太顺，手敲键盘有点飘的那种感觉。应该是一小时左右写完，刷下</span><span lang="EN-US">rank</span><span style="font-family: 宋体;">，发现第一名</span><span lang="EN-US">3</span><span style="font-family: 宋体;">个题</span><span lang="EN-US">ms</span><span style="font-family: 宋体;">，有点</span><span lang="EN-US">ft&#8230;</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">测了下不过</span><span lang="EN-US">sample</span><span style="font-family: 宋体;">，然后发现各种傻错误（包括输入），这时候感觉</span><span lang="EN-US">lunar</span><span style="font-family: 宋体;">有点急，频频向我这边看，并建议我下来他写。</span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">由于历史上发生过我一开始不太顺，</span><span lang="EN-US">lunar</span><span style="font-family: 宋体;">抢键盘结果一开始还可以，最后挂掉的情况，于是我坚决占着键盘（事后据说</span><span lang="EN-US">Lunar</span><span style="font-family: 宋体;">当时已经扫完整个</span><span lang="EN-US">problem
set</span><span style="font-family: 宋体;">了，。。。）。。。不过这样非常不爽就是了。。。</span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">过了会还是被</span><span lang="EN-US">lunar</span><span style="font-family: 宋体;">轰下键盘，跑去洗手间稳定了下，回来研究程序，最后在</span><st1:chmetcnv unitname="m" sourcevalue="77" hasspace="False" negative="False" numbertype="1" tcsc="0" w:st="on"><span lang="EN-US">77m</span></st1:chmetcnv><span lang="EN-US"> 1Y K</span><span style="font-family: 宋体;">。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">随后看了两道题后</span><span lang="EN-US">LK</span><span style="font-family: 宋体;">给我讲</span><span lang="EN-US">F</span><span style="font-family: 宋体;">思路，这时候明显感觉不对劲，一般说来，</span><span lang="EN-US">LK</span><span style="font-family: 宋体;">在急的时候说话会比较快，这个我在</span><span lang="EN-US">Changchun &amp; Dhaka</span><span style="font-family: 宋体;">我们队大比分落后的时候我有所经历。。。但是这次，她除了说的很快之外还感觉声音发虚，这个是我从未见过的。。。然后感觉讲题的思维有点乱。。。当时就比较一筹莫展。。。不过最后还是弄懂了她的意思。。。我推。</span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">我只能说我也没太进状态，在</span><span lang="EN-US">+-1</span><span style="font-family: 宋体;">的地方推错了无数次后终于推了个，交，</span><span lang="EN-US">WA</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">于是。。。我觉得这个样子不行了。。。决定搞点冰水来清醒一下。。。随后发现有雪碧。。。还有。。。</span><span lang="EN-US">diet</span><span style="font-family: 宋体;">可乐，盗版一下</span><span lang="EN-US">AK</span><span style="font-family: 宋体;">的句式就是。。。对于</span><span lang="EN-US">LK</span><span style="font-family: 宋体;">来说，</span><span lang="EN-US">diet</span><span style="font-family: 宋体;">可乐就是题目。。。～～～～～，顿时眼前一亮，问了一下，可以带入场。。。生活太美好了。。。</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">有可乐就好办了（事后据</span><span lang="EN-US">LK</span><span style="font-family: 宋体;">说。。。她是那之后才感觉&#8220;醒&#8221;来的）。。。然后发现</span><span lang="EN-US">F</span><span style="font-family: 宋体;">有个地方我们交流错了，改了之后换了个气球。然后发现</span><span lang="EN-US">B</span><span style="font-family: 宋体;">是个土题</span><span lang="EN-US"> in disguise</span><span style="font-family: 宋体;">。。。反正之后</span><span lang="EN-US">AB</span><span style="font-family: 宋体;">都出了。。。（</span><span lang="EN-US">A</span><span style="font-family: 宋体;">是</span><span lang="EN-US">lunar</span><span style="font-family: 宋体;">写的）</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">这时候我们大概冲到了</span><span lang="EN-US">7th/6<sup>th</sup></span><span style="font-family: 宋体;">的感觉。。。当时觉得很有戏啊。。。</span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">随后</span><span lang="EN-US">Lunar</span><span style="font-family: 宋体;">写</span><span lang="EN-US">D</span><span style="font-family: 宋体;">，我们看剩下的题目。我</span><span lang="EN-US">I</span><span style="font-family: 宋体;">应该还是反应了好一会儿的，悟出来是在字符串</span><span lang="EN-US">DFA</span><span style="font-family: 宋体;">上</span><span lang="EN-US">DP&#8230;</span><span style="font-family: 宋体;">然后输方案有个地方想错了导致我没想出怎么输方案。等到想出来开始写应该是</span><span lang="EN-US">3.5</span><span style="font-family: 宋体;">小时以后。。。</span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">然后大体是交</span><span lang="EN-US">,RE, </span><span style="font-family: 宋体;">数组打错，再交</span><span lang="EN-US">,WA,</span><span style="font-family: 宋体;">发现有个地方错误，再交。。。</span><span lang="EN-US">Yes&#8230;</span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">这时候还有</span><span lang="EN-US">20</span><span style="font-family: 宋体;">分钟</span><span lang="EN-US">(?)</span><span style="font-family: 宋体;">。。。然后。。。最后还是没调出</span><span lang="EN-US">D.</span></p>
<p class="MsoNormal"><span style="font-family: 宋体;">最终被踩到</span><span lang="EN-US">18th&#8230;</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p></o:p><hr style="width: 100%; height: 2px;">&nbsp;<br></span></p>
<p class="MsoNormal"><br><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>虽然有一点我们没有达成共识。</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>但我的观点是，</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>我们确实在<span style="font-weight: bold;">实力</span>上输了，</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>是的，可以说我们没有发挥的不好。</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>但是，考虑到比赛的紧张因素等，一般都是100的实力发挥80。</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>我们这至少应该发挥了70的，我可以说我们发挥的<span style="font-weight: bold;">不足够好</span>，<span style="font-weight: bold;">没有期望的好</span>，如果我们正常发挥<span style="font-weight: bold;">可能</span>可以再前进一些，或许如果运气好一些就有牌了。</o:p></span></p>
<br>如果正常的发挥从来没有出现过，或者n次才出现一次，<br>那他就不是正常发挥，而是超常发挥。就这么简单。<br><br><br>如果你想表现出100的实力，你必须按照120的实力去准备。<br>是的，Jordan每次都可以表现出100的实力，那是因为，他拥有150的实力。<br>而我们只有100的实力，所以我们一般情况下只能发挥出80的实力，<br>
<p class="MsoNormal"><span lang="EN-US"><o:p>是的，如果我们发挥的再好一点（一开始进状态快一点等），我们可以7个题，我不否认这一点，当时我确实觉得7个题很有希望。。。，如果再好一些，或许8个题也不是没有可能。</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>但这么说有意义么？或许SPb IMFO会觉得这么简单的题目应该过9个还差不多。。。或者是10个？...<br></o:p></span></p>
<p class="MsoNormal"><br><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p><br></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p><img src ="http://www.cppblog.com/FreePeter/aggbug/46843.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/FreePeter/" target="_blank">FreePeter</a> 2008-04-11 16:03 <a href="http://www.cppblog.com/FreePeter/archive/2008/04/11/46843.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>比较郁闷的 @ Banff, CA</title><link>http://www.cppblog.com/FreePeter/archive/2008/04/10/46754.html</link><dc:creator>FreePeter</dc:creator><author>FreePeter</author><pubDate>Thu, 10 Apr 2008 05:42:00 GMT</pubDate><guid>http://www.cppblog.com/FreePeter/archive/2008/04/10/46754.html</guid><wfw:comment>http://www.cppblog.com/FreePeter/comments/46754.html</wfw:comment><comments>http://www.cppblog.com/FreePeter/archive/2008/04/10/46754.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/FreePeter/comments/commentRss/46754.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/FreePeter/services/trackbacks/46754.html</trackback:ping><description><![CDATA[其实我比较想睡觉现在。。。<br><br>郁闷的重新开始翻dwy的blog...<br><br><br>引用一句dwy的话：<br>其实我的心情倒还好，只是有很多东西需要去理清楚。比较孤独，虽然有自己的队，但是并没有真正可以说话的人，所以只能对自己说。<br><br> <img src ="http://www.cppblog.com/FreePeter/aggbug/46754.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/FreePeter/" target="_blank">FreePeter</a> 2008-04-10 13:42 <a href="http://www.cppblog.com/FreePeter/archive/2008/04/10/46754.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>URAL championship, B, Tram Tile</title><link>http://www.cppblog.com/FreePeter/archive/2008/03/30/45770.html</link><dc:creator>FreePeter</dc:creator><author>FreePeter</author><pubDate>Sun, 30 Mar 2008 14:10:00 GMT</pubDate><guid>http://www.cppblog.com/FreePeter/archive/2008/03/30/45770.html</guid><wfw:comment>http://www.cppblog.com/FreePeter/comments/45770.html</wfw:comment><comments>http://www.cppblog.com/FreePeter/archive/2008/03/30/45770.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/FreePeter/comments/commentRss/45770.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/FreePeter/services/trackbacks/45770.html</trackback:ping><description><![CDATA[据说标准做法是状态压缩dp...<br><br>当然我们上来一反应就是yy几种策略。。。<br>于是就死wa啊死wa...<br>于是最后判断了n种情况。。。终于过了～～～<br><br><br><br><img src ="http://www.cppblog.com/FreePeter/aggbug/45770.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/FreePeter/" target="_blank">FreePeter</a> 2008-03-30 22:10 <a href="http://www.cppblog.com/FreePeter/archive/2008/03/30/45770.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>TCO Round1, [500], CHOMP Game...</title><link>http://www.cppblog.com/FreePeter/archive/2008/02/17/Chomp_Game.html</link><dc:creator>FreePeter</dc:creator><author>FreePeter</author><pubDate>Sat, 16 Feb 2008 20:15:00 GMT</pubDate><guid>http://www.cppblog.com/FreePeter/archive/2008/02/17/Chomp_Game.html</guid><wfw:comment>http://www.cppblog.com/FreePeter/comments/42825.html</wfw:comment><comments>http://www.cppblog.com/FreePeter/archive/2008/02/17/Chomp_Game.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cppblog.com/FreePeter/comments/commentRss/42825.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/FreePeter/services/trackbacks/42825.html</trackback:ping><description><![CDATA[500分的题。。。<br>由于之前看到过chomp game，(《Game Theory》的练习里有)，然后开始试图推公式之类的。。。在wiki上找到rectangle情况先手必胜的证明：
<br>
<p>Who wins?</p>
<p>Chomp belongs to the category of impartial 2-player perfect information games.</p>
<p>It turns out that for any rectangular starting position bigger than 1 &#215; 1 the 1st player can win. This can be shown using a strategy-stealing argument:
assume that the 2nd player has a winning strategy against any initial
1st player move. Suppose then, that the 1st player takes only the
bottom right hand square. By our assumption, the 2nd player has a
response to this which will force victory. But if such a winning
response exists, the 1st player could have played it as his first move
and thus forced victory. The 2nd player therefore cannot have a winning
strategy.</p>
<p>Computers can easily calculate winning moves for this game on two-dimensional boards of reasonable size.</p>
<br>很优美的证明。。。只可惜不能提供任何strategy...-_-bbbbbbbb<br>最后终于悟出来这题规定棋盘3*n, n&lt;=100,所以就100*100*100的dp就行了。。-_-bbbbbbbbbb<br><br><br>p.s. <a title="wiki : chomp game" href="http://en.wikipedia.org/wiki/Chomp">wiki : Chomp Game</a><br><br><br>p.s. 确实觉得一知半解是一个很容易出错的情况...因为如果完全不知道思维也就没有任何限制了,曾经看到过么...感觉会有点紧张(想要赶紧搞掉的那种感觉) &amp; 试图用记忆中的套路去做...但有时候可能没有关系(例如这个game, 先手必胜的证明并不能提供任何先手如何operate的信息...,如果继续往这个上面想就直接挂了...-_-bbbbbbb)<br>还有就是有可能会出现类似于"当时为什么不仔细推清楚"之类的念头...这个seems容易解决...<br><br>感觉如果是完全陌生的题想法通常容易比较open, 如果感觉这个模型熟悉一般都会试图往熟悉的模型上套...大多数情况下这样确实可以节省时间...但是如果失去了open的思维 + 熟悉的模型无法解决就orz了...<br><br><br> <img src ="http://www.cppblog.com/FreePeter/aggbug/42825.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/FreePeter/" target="_blank">FreePeter</a> 2008-02-17 04:15 <a href="http://www.cppblog.com/FreePeter/archive/2008/02/17/Chomp_Game.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[Overview] Arab and North Africa 2007, ANARC2007</title><link>http://www.cppblog.com/FreePeter/archive/2008/02/16/Overview_To_ANARC2007.html</link><dc:creator>FreePeter</dc:creator><author>FreePeter</author><pubDate>Sat, 16 Feb 2008 10:24:00 GMT</pubDate><guid>http://www.cppblog.com/FreePeter/archive/2008/02/16/Overview_To_ANARC2007.html</guid><wfw:comment>http://www.cppblog.com/FreePeter/comments/42809.html</wfw:comment><comments>http://www.cppblog.com/FreePeter/archive/2008/02/16/Overview_To_ANARC2007.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cppblog.com/FreePeter/comments/commentRss/42809.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/FreePeter/services/trackbacks/42809.html</trackback:ping><description><![CDATA[      [Overview] Arab and North Africa 2007, ANARC2007<br><br><a href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3507"><u><font color="#800080">Judging Olympia</font></u></a><br>弱智题<br><a href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3508"><u><font color="#800080">Hide That Number</font></u></a><br>利用mod11的性质直接算出前面应该补充什么。<br><a href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3509"><u><font color="#800080">Rotating Rings</font></u></a><br>每层判断是否可行。<br><a href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3510"><u><font color="#800080">A Tale from the Dark Side of the Moon</font></u></a><br>据说是无聊题<br><a href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3511"><u><font color="#800080">Fermat's Chirstmas Theorem</font></u></a><br>预处理素数列表 + 直接回答，注意2也是第二类素数<br><a href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3512"><u><font color="#800080">Incidental Points</font></u></a><br>经典题，枚举一个点，算出其他点相对于它的向量，问题就变成count同样的向量有多少个，sort / hash都可以。。。<br><a href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3513">Let's Go to the Movies</a><br>简单的DP题<br><a href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3514">The Writer's Club</a><br>writer之间求一下传递闭包，然后把所有是某个writer的reader合并起来，可以用32位压int来优化.<br><a href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3515">Moving Sticks</a><br>
据说直接搜就可以了。To be written<br><a href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3516">Johnny Hates Math</a><br>经典的DP，用BFS来实现。内存稍微有点紧。<br><br>
<br><img src ="http://www.cppblog.com/FreePeter/aggbug/42809.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/FreePeter/" target="_blank">FreePeter</a> 2008-02-16 18:24 <a href="http://www.cppblog.com/FreePeter/archive/2008/02/16/Overview_To_ANARC2007.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Publish一下NWERC, CERC, SEERC 2007的解题报告。。。</title><link>http://www.cppblog.com/FreePeter/archive/2008/02/09/42612.html</link><dc:creator>FreePeter</dc:creator><author>FreePeter</author><pubDate>Sat, 09 Feb 2008 11:54:00 GMT</pubDate><guid>http://www.cppblog.com/FreePeter/archive/2008/02/09/42612.html</guid><wfw:comment>http://www.cppblog.com/FreePeter/comments/42612.html</wfw:comment><comments>http://www.cppblog.com/FreePeter/archive/2008/02/09/42612.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/FreePeter/comments/commentRss/42612.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/FreePeter/services/trackbacks/42612.html</trackback:ping><description><![CDATA[<a id=CategoryEntryList1_EntryStoryList_Entries_ctl00_TitleUrl href="http://www.cppblog.com/FreePeter/articles/Solution_To_NWERC2007.html"><u><font color=#800080>Northwestern Europe (NWERC) 2007 解题报告</font></u></a><br><a id=CategoryEntryList1_EntryStoryList_Entries_ctl03_TitleUrl href="http://www.cppblog.com/FreePeter/articles/Solution_To_Central_Europe_2007.html"><u><font color=#800080>Central Europe 2007解题报告</font></u></a><br><a id=CategoryEntryList1_EntryStoryList_Entries_ctl04_TitleUrl href="http://www.cppblog.com/FreePeter/articles/Solution_To_Southeastern_Europe_2007.html"><u><font color=#800080>Southeastern Europe 2007解题报告</font></u></a><br><br>顺便增加以下这三个页面的PR...~~~ 
<img src ="http://www.cppblog.com/FreePeter/aggbug/42612.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/FreePeter/" target="_blank">FreePeter</a> 2008-02-09 19:54 <a href="http://www.cppblog.com/FreePeter/archive/2008/02/09/42612.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ZOJ Monthly, January 2008解题报告</title><link>http://www.cppblog.com/FreePeter/archive/2008/01/27/41951.html</link><dc:creator>FreePeter</dc:creator><author>FreePeter</author><pubDate>Sun, 27 Jan 2008 04:22:00 GMT</pubDate><guid>http://www.cppblog.com/FreePeter/archive/2008/01/27/41951.html</guid><wfw:comment>http://www.cppblog.com/FreePeter/comments/41951.html</wfw:comment><comments>http://www.cppblog.com/FreePeter/archive/2008/01/27/41951.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/FreePeter/comments/commentRss/41951.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/FreePeter/services/trackbacks/41951.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 2894  	  Arrange the Problem Set  	  <br>2895 	  Cache 	  <br>2896 	  Common Factor 	  <br>2897 	  Desmond's Ambition 	  <br>2898 	  Greedy Grave Robber 	  <br>2899 	  Hangzhou Tour 	 <br>2900 	  Icecream 	  <br>2901 	  MV Maker 	  <br>2902 	  Ten drops 	 <br>&nbsp;&nbsp;<a href='http://www.cppblog.com/FreePeter/archive/2008/01/27/41951.html'>阅读全文</a><img src ="http://www.cppblog.com/FreePeter/aggbug/41951.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/FreePeter/" target="_blank">FreePeter</a> 2008-01-27 12:22 <a href="http://www.cppblog.com/FreePeter/archive/2008/01/27/41951.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[SUMMARY]最近作的几道题</title><link>http://www.cppblog.com/FreePeter/archive/2008/01/24/41811.html</link><dc:creator>FreePeter</dc:creator><author>FreePeter</author><pubDate>Thu, 24 Jan 2008 07:13:00 GMT</pubDate><guid>http://www.cppblog.com/FreePeter/archive/2008/01/24/41811.html</guid><wfw:comment>http://www.cppblog.com/FreePeter/comments/41811.html</wfw:comment><comments>http://www.cppblog.com/FreePeter/archive/2008/01/24/41811.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/FreePeter/comments/commentRss/41811.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/FreePeter/services/trackbacks/41811.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Northwestern Europe 2005 Unequalled Consumption<br>SPOJ 598, INCR<br>Dhaka 2007 The Dumb Grocer<br>Dhaka 2007 You are around me ...<br>Dhaka 2007 Magnetic Train Tracks<br>解题报告<br>&nbsp;&nbsp;<a href='http://www.cppblog.com/FreePeter/archive/2008/01/24/41811.html'>阅读全文</a><img src ="http://www.cppblog.com/FreePeter/aggbug/41811.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/FreePeter/" target="_blank">FreePeter</a> 2008-01-24 15:13 <a href="http://www.cppblog.com/FreePeter/archive/2008/01/24/41811.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>