﻿<?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++博客-syhd142-最新评论</title><link>http://www.cppblog.com/syhd142/CommentsRSS.aspx</link><description /><language>zh-cn</language><pubDate>Wed, 24 Aug 2011 14:49:06 GMT</pubDate><lastBuildDate>Wed, 24 Aug 2011 14:49:06 GMT</lastBuildDate><generator>cnblogs</generator><item><title>re: 如何Emacs显示行号和括号匹配</title><link>http://www.cppblog.com/syhd142/archive/2011/08/25/130890.html#154354</link><dc:creator>bqdx</dc:creator><author>bqdx</author><pubDate>Thu, 25 Aug 2011 09:42:00 GMT</pubDate><guid>http://www.cppblog.com/syhd142/archive/2011/08/25/130890.html#154354</guid><description><![CDATA[多谢分享<br>括号匹配那个功能很赞<img src ="http://www.cppblog.com/syhd142/aggbug/154354.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/syhd142/" target="_blank">bqdx</a> 2011-08-25 17:42 <a href="http://www.cppblog.com/syhd142/archive/2011/08/25/130890.html#154354#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: HDU 1494 跑跑卡丁车</title><link>http://www.cppblog.com/syhd142/archive/2011/08/16/126271.html#153578</link><dc:creator>Fucker</dc:creator><author>Fucker</author><pubDate>Tue, 16 Aug 2011 09:31:00 GMT</pubDate><guid>http://www.cppblog.com/syhd142/archive/2011/08/16/126271.html#153578</guid><description><![CDATA[当初我的是过了的啊@boychao@163.com<br><img src ="http://www.cppblog.com/syhd142/aggbug/153578.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/syhd142/" target="_blank">Fucker</a> 2011-08-16 17:31 <a href="http://www.cppblog.com/syhd142/archive/2011/08/16/126271.html#153578#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: HDU 1494 跑跑卡丁车</title><link>http://www.cppblog.com/syhd142/archive/2011/08/16/126271.html#153574</link><dc:creator>boychao@163.com</dc:creator><author>boychao@163.com</author><pubDate>Tue, 16 Aug 2011 09:13:00 GMT</pubDate><guid>http://www.cppblog.com/syhd142/archive/2011/08/16/126271.html#153574</guid><description><![CDATA[你这代码超时了.....<img src ="http://www.cppblog.com/syhd142/aggbug/153574.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/syhd142/" target="_blank">boychao@163.com</a> 2011-08-16 17:13 <a href="http://www.cppblog.com/syhd142/archive/2011/08/16/126271.html#153574#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: HDU 1059 Dividing</title><link>http://www.cppblog.com/syhd142/archive/2011/08/02/121289.html#152303</link><dc:creator>songzhongping</dc:creator><author>songzhongping</author><pubDate>Tue, 02 Aug 2011 10:57:00 GMT</pubDate><guid>http://www.cppblog.com/syhd142/archive/2011/08/02/121289.html#152303</guid><description><![CDATA[#include &lt;cstdlib&gt;<br>#include &lt;stdio.h&gt;<br>#include &lt;iostream&gt;<br><br><br>using namespace std;<br> int f[60005];<br> #define MAX(a,b)  a&gt;b?a:b<br> void Complete(int cost, int weight, int m)<br>{<br>    for(int i = cost; i &lt;= m; i++)<br>        f[i] = MAX(f[i], f[i - cost] + weight);<br>}<br>void Zero_One(int cost, int weight, int m)<br>{<br>    for(int i = m; i &gt;= cost; i--)<br>        f[i] = MAX(f[i], f[i - cost] + weight);<br>}<br><br>int main(int argc, char *argv[])<br>{ <br>    int a[7],n,i,j,sum,t=0;<br>    while(1)<br>    {   <br>        sum=0;<br>       <br>        for(i=1;i&lt;7;i++)<br>        {<br>          scanf(&quot;%d&quot;,a+i);<br>          sum+=a[i]*i;<br>        }<br>        if(!sum)  break;<br>        if(sum&amp;1)<br>        {   printf(&quot;Collection #%d:\n&quot;,++t);<br>             puts(&quot;Can't be divided.\n&quot;);   <br>            continue;<br>        }<br>           sum &gt;&gt;= 1;<br>            memset(f,0,sizeof(f));<br>          for(i=1;i&lt;7;i++)<br>          {<br>            if(a[i]*i&gt;=sum)<br>            {<br>             Complete(i,i,sum);<br>            }<br>            else  if(a[i]&gt;0)<br>            {<br>              int k=1;<br>              while(k&lt;a[i])<br>                  {<br>                     Zero_One(k*i,k*i,sum) ;      <br>                       a[i]-=k;<br>                       k &lt;&lt;= 1;<br>                  }<br>              for(j=sum;j&gt;=i*a[i];j--)<br>               {<br>                Zero_One(a[i]*i,a[i]*i,sum);<br>               }<br>           }<br>          }<br>          <br>          if(f[sum]==sum)<br>          {<br>           printf(&quot;Collection #%d:\n&quot;,++t);<br>            puts(&quot;Can be divided.\n&quot;);<br><br>           }<br>          else<br>           {printf(&quot;Collection #%d:\n&quot;,++t);<br>            puts(&quot;Can't be divided.\n&quot;);<br><br>           }<br>        <br>    }<br>   // system(&quot;PAUSE&quot;);<br>    return EXIT_SUCCESS;<br>}<br>//这是我的代码为什么总是超时呢？求解释。。<img src ="http://www.cppblog.com/syhd142/aggbug/152303.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/syhd142/" target="_blank">songzhongping</a> 2011-08-02 18:57 <a href="http://www.cppblog.com/syhd142/archive/2011/08/02/121289.html#152303#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: HDU 2896 病毒侵袭</title><link>http://www.cppblog.com/syhd142/archive/2011/05/14/138223.html#146361</link><dc:creator>小尼人00</dc:creator><author>小尼人00</author><pubDate>Sat, 14 May 2011 05:04:00 GMT</pubDate><guid>http://www.cppblog.com/syhd142/archive/2011/05/14/138223.html#146361</guid><description><![CDATA[#include &lt;stdio.h&gt;<br>#include &lt;string.h&gt;<br>#include &lt;math.h&gt;<br>#include &lt;vector&gt;<br>#include &lt;iostream&gt;<br>#include &lt;set&gt;<br>#include &lt;algorithm&gt;<br>#include &lt;queue&gt;<br>using namespace std;<br><br>#define kind 129<br>#define M 10010<br><br>struct node {<br>    node *fail;<br>    node *next[kind];<br>    int id;<br>    node() { //构造函数<br>        fail = NULL;<br>        id = 0;<br>        memset(next, NULL, sizeof(next));<br>    }<br>};<br><br>char ch[M]; //键盘输入的串<br>queue&lt;node *&gt; q;<br>set &lt;int&gt; g;<br>int n, m;<br><br>void insert(node *root, char *str, int num) {<br>    node *p = root;<br>    int i = 0, index;<br>    while(str[i]) {<br>        index = str[i] - 'a';<br>        if(p-&gt;next[index] == NULL) {<br>            p-&gt;next[index] = new node();<br>        }<br>            p = p-&gt;next[index];<br>            i++;<br>    }<br>    p-&gt;id = num;<br>}<br><br>void AC (node *&amp;root) {  ///root -&gt; fail = NULL;<br>    q.push(root);<br>    while(!q.empty()) {<br>        node *p = NULL;<br>        node *t = q.front();<br>        q.pop();<br>        for(int i = 0; i &lt; kind; i++) {<br><br>            if(t-&gt;next[i]) {<br><br>                p = t-&gt;fail;<br><br>                while(p) {<br>                    if(p-&gt;next[i]) {<br>                        t-&gt;next[i]-&gt;fail = p-&gt;next[i];<br>                        break;<br>                    }<br>                    p = p-&gt;fail;<br>                }<br>                if(!p) t-&gt;next[i]-&gt;fail = NULL;<br>                q.push(t-&gt;next[i]);<br>            }<br>        }<br>    }<br>}<br><br>bool query(node *&amp;root, char *str, int ca) {<br>    g.clear();<br>    int i = 0, t, flag = 0;<br>    node *p = root, *tmp;<br>    while(str[i]) {<br>        t = str[i] - 'a';<br>        while(!p-&gt;next[t] &amp;&amp; p != root) { p = p-&gt;fail; }<br>        ///*****************************///<br>        p = p-&gt;next[t];<br>        ///******************************///<br>        if(!p) p = root;<br>        tmp = p;<br>        while(tmp != root &amp;&amp; tmp-&gt;id) {<br>            flag = 1;<br>            g.insert(tmp-&gt;id);<br>            tmp = tmp-&gt;fail;<br>        }<br>        i++;<br>    }<br>    if(!flag) return false;<br>    printf(&quot;web %d:&quot;, ca);<br>    for(set&lt;int&gt;::iterator it = g.begin(); it != g.end(); it++) {<br>        cout &lt;&lt; ' ' &lt;&lt; *it;<br>    }<br>    cout &lt;&lt; endl;<br>    return true;<br>}<br><br>int main() {<br>    int total;<br>    while(~scanf(&quot;%d&quot;, &amp;n)) {<br>        node *root = new node();<br>        total = 0;<br>        for(int i = 0; i &lt; n; i++) {<br>            scanf(&quot;%s&quot;, ch);<br>            insert(root, ch, i+1);<br>        }<br>        AC(root);<br>        cin &gt;&gt; n;<br>        for(int i = 0; i &lt; n; i++) {<br>            cin &gt;&gt; ch;<br>            if(query(root, ch, i+1)); total++;<br>        }<br>        printf(&quot;total: %d\n&quot;, total);<br>    }<br>    return 0;<br>}<br><br><br><br><br><br><br><br><br>帮忙看看吧！楼主，照你的写的，但是还是不行，输入都不行<img src ="http://www.cppblog.com/syhd142/aggbug/146361.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/syhd142/" target="_blank">小尼人00</a> 2011-05-14 13:04 <a href="http://www.cppblog.com/syhd142/archive/2011/05/14/138223.html#146361#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: UVA 624 CD</title><link>http://www.cppblog.com/syhd142/archive/2011/03/31/118968.html#143110</link><dc:creator>Fucker</dc:creator><author>Fucker</author><pubDate>Thu, 31 Mar 2011 06:32:00 GMT</pubDate><guid>http://www.cppblog.com/syhd142/archive/2011/03/31/118968.html#143110</guid><description><![CDATA[@alien<br>额，有点遥远了，都忘记了。<img src ="http://www.cppblog.com/syhd142/aggbug/143110.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/syhd142/" target="_blank">Fucker</a> 2011-03-31 14:32 <a href="http://www.cppblog.com/syhd142/archive/2011/03/31/118968.html#143110#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: UVA 624 CD</title><link>http://www.cppblog.com/syhd142/archive/2011/03/31/118968.html#143105</link><dc:creator>alien</dc:creator><author>alien</author><pubDate>Thu, 31 Mar 2011 05:57:00 GMT</pubDate><guid>http://www.cppblog.com/syhd142/archive/2011/03/31/118968.html#143105</guid><description><![CDATA[最后一组数据好像通不过。<br>45 8 4 10 44 43 12 9 8 2<br>这组我用你的程序计算出来的是43 2 sum:45.<br>应该是4 10 12 9 8 2 sum:45<br>为什么可以这样记录路径？<img src ="http://www.cppblog.com/syhd142/aggbug/143105.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/syhd142/" target="_blank">alien</a> 2011-03-31 13:57 <a href="http://www.cppblog.com/syhd142/archive/2011/03/31/118968.html#143105#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: UVA 11594 All Pairs Maximum Flow</title><link>http://www.cppblog.com/syhd142/archive/2011/02/12/119887.html#139929</link><dc:creator>Ziwen</dc:creator><author>Ziwen</author><pubDate>Sat, 12 Feb 2011 03:29:00 GMT</pubDate><guid>http://www.cppblog.com/syhd142/archive/2011/02/12/119887.html#139929</guid><description><![CDATA[能不能把论文给我发一份<br>THX<br>Very Simple Methods for All Pairs Network Flow Analysis<br>caocao9926@163.com<img src ="http://www.cppblog.com/syhd142/aggbug/139929.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/syhd142/" target="_blank">Ziwen</a> 2011-02-12 11:29 <a href="http://www.cppblog.com/syhd142/archive/2011/02/12/119887.html#139929#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: UVA 10003 Cutting Sticks</title><link>http://www.cppblog.com/syhd142/archive/2010/11/17/118133.html#133879</link><dc:creator>jerrymu1234</dc:creator><author>jerrymu1234</author><pubDate>Wed, 17 Nov 2010 06:01:00 GMT</pubDate><guid>http://www.cppblog.com/syhd142/archive/2010/11/17/118133.html#133879</guid><description><![CDATA[请教楼主： <br><br>如何在求minimum cost值的同时， <br>记录所cut的点的次序??被困扰好久。。。。。 <br><br>比如input: <br>10 (木棍长) <br>3 （切3次） <br>2 4 7 （在2，4，7处切） <br>Output: <br>The minimum cost is 20. <br>The optimal cutting sequence: 4,2,7<img src ="http://www.cppblog.com/syhd142/aggbug/133879.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/syhd142/" target="_blank">jerrymu1234</a> 2010-11-17 14:01 <a href="http://www.cppblog.com/syhd142/archive/2010/11/17/118133.html#133879#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: UVA 10819 Trouble of 13-Dots</title><link>http://www.cppblog.com/syhd142/archive/2010/11/14/118985.html#133560</link><dc:creator>Fucker</dc:creator><author>Fucker</author><pubDate>Sat, 13 Nov 2010 16:26:00 GMT</pubDate><guid>http://www.cppblog.com/syhd142/archive/2010/11/14/118985.html#133560</guid><description><![CDATA[@想<br>背包九讲里面貌似有说。<img src ="http://www.cppblog.com/syhd142/aggbug/133560.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/syhd142/" target="_blank">Fucker</a> 2010-11-14 00:26 <a href="http://www.cppblog.com/syhd142/archive/2010/11/14/118985.html#133560#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>