﻿<?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++博客-Victordu</title><link>http://www.cppblog.com/Victordu/</link><description>英雄做事无他 只坚韧一心 能成世界能成我</description><language>zh-cn</language><lastBuildDate>Thu, 23 Apr 2026 10:13:47 GMT</lastBuildDate><pubDate>Thu, 23 Apr 2026 10:13:47 GMT</pubDate><ttl>60</ttl><item><title>PKU 3193 STL</title><link>http://www.cppblog.com/Victordu/archive/2008/09/10/61532.html</link><dc:creator>Victordu</dc:creator><author>Victordu</author><pubDate>Wed, 10 Sep 2008 13:00:00 GMT</pubDate><guid>http://www.cppblog.com/Victordu/archive/2008/09/10/61532.html</guid><wfw:comment>http://www.cppblog.com/Victordu/comments/61532.html</wfw:comment><comments>http://www.cppblog.com/Victordu/archive/2008/09/10/61532.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Victordu/comments/commentRss/61532.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Victordu/services/trackbacks/61532.html</trackback:ping><description><![CDATA[好久没写了 太懒了 太菜了 <br>这个题因为不会写 虽然不难 但是STL我实在知道的太少了 所以贴一下 备忘<br><br>#include &lt;iostream&gt;<br>#include &lt;set&gt;<br>#include &lt;cstring&gt;<br><br>using namespace std;<br><br><br>int main()<br>{<br>&nbsp;&nbsp;&nbsp; int i,j,sum=0;<br>&nbsp;&nbsp;&nbsp; int m,n;<br>&nbsp;&nbsp;&nbsp; char str[100],word[10000][100];<br>&nbsp;&nbsp;&nbsp; set&lt;string&gt;s;<br>&nbsp;&nbsp;&nbsp; set&lt;string&gt;::iterator it;<br><br>&nbsp;&nbsp;&nbsp; cin&gt;&gt;m&gt;&gt;n;<br>&nbsp;&nbsp;&nbsp; getchar();<br>&nbsp;&nbsp;&nbsp; for(i=0;i&lt;m;i++)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; gets(str);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; s.insert(str);<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; for(it=s.begin(),i=0;it!=s.end();it++)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strcpy(word[i++],(*it).c_str());<br><br>&nbsp;&nbsp;&nbsp; int high,low,mid;<br><br>&nbsp;&nbsp;&nbsp; for(i=0;i&lt;n;i++)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; gets(str);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; low=0;high=m-1;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while(low&lt;high-1)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mid=(low+high)/2;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(strcmp(word[mid],str)&lt;0) low=mid;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else high=mid;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for(j=low;j&lt;=high;j++)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(strstr(word[j],str)==word[j]) {sum++;break;}<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; cout&lt;&lt;sum&lt;&lt;endl;<br><br>}<br><br><br><img src ="http://www.cppblog.com/Victordu/aggbug/61532.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Victordu/" target="_blank">Victordu</a> 2008-09-10 21:00 <a href="http://www.cppblog.com/Victordu/archive/2008/09/10/61532.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>POJ 2453 强大的位运算</title><link>http://www.cppblog.com/Victordu/archive/2008/08/22/59638.html</link><dc:creator>Victordu</dc:creator><author>Victordu</author><pubDate>Fri, 22 Aug 2008 04:48:00 GMT</pubDate><guid>http://www.cppblog.com/Victordu/archive/2008/08/22/59638.html</guid><wfw:comment>http://www.cppblog.com/Victordu/comments/59638.html</wfw:comment><comments>http://www.cppblog.com/Victordu/archive/2008/08/22/59638.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/Victordu/comments/commentRss/59638.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Victordu/services/trackbacks/59638.html</trackback:ping><description><![CDATA[这个是说 给你一个数 找出比他大的最小的一个数 满足二进制中1的个数和他相同<br><br>看到了一个人写的很强大的位运算代码<br><br>#include &lt;stdio.h&gt;<br>int main()<br>{<br>&nbsp;&nbsp;&nbsp; int n,x;<br>&nbsp;&nbsp;&nbsp; while(scanf("%d",&amp;n),n)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; x=n&amp;-n;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf("%d\n",n+x+(n^n+x)/x/4);<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>x呢 是最后一个1出现的<br>n＋x 是从后往前第一个01转化为10<br>n^n+x/x/4就是把所有后面的1后移了<br><br>Orz阿Orz。。。。。。<br><br><img src ="http://www.cppblog.com/Victordu/aggbug/59638.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Victordu/" target="_blank">Victordu</a> 2008-08-22 12:48 <a href="http://www.cppblog.com/Victordu/archive/2008/08/22/59638.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>POJ 2546 简单几何</title><link>http://www.cppblog.com/Victordu/archive/2008/08/19/59382.html</link><dc:creator>Victordu</dc:creator><author>Victordu</author><pubDate>Tue, 19 Aug 2008 13:13:00 GMT</pubDate><guid>http://www.cppblog.com/Victordu/archive/2008/08/19/59382.html</guid><wfw:comment>http://www.cppblog.com/Victordu/comments/59382.html</wfw:comment><comments>http://www.cppblog.com/Victordu/archive/2008/08/19/59382.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Victordu/comments/commentRss/59382.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Victordu/services/trackbacks/59382.html</trackback:ping><description><![CDATA[求两圆相交面积 两个弧形面积之和减去两个三角形面积<br>噢 如果没有相交 或者内含 内切的话就是0<br>好吧 还是水题。。。<br><br><img src ="http://www.cppblog.com/Victordu/aggbug/59382.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Victordu/" target="_blank">Victordu</a> 2008-08-19 21:13 <a href="http://www.cppblog.com/Victordu/archive/2008/08/19/59382.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>POJ 2363 枚举</title><link>http://www.cppblog.com/Victordu/archive/2008/08/19/59378.html</link><dc:creator>Victordu</dc:creator><author>Victordu</author><pubDate>Tue, 19 Aug 2008 12:47:00 GMT</pubDate><guid>http://www.cppblog.com/Victordu/archive/2008/08/19/59378.html</guid><wfw:comment>http://www.cppblog.com/Victordu/comments/59378.html</wfw:comment><comments>http://www.cppblog.com/Victordu/archive/2008/08/19/59378.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Victordu/comments/commentRss/59378.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Victordu/services/trackbacks/59378.html</trackback:ping><description><![CDATA[这一题是说给N个1＊1＊1的立方体 问把他们堆一起表面积最小是多少<br>就是枚举吧 找到三个数乘积等于体积 记录最小表面积<br><br>好吧 我只会做水题 <br>下午的比赛做得极其郁闷 吃饭的时候三个人都不很爽<br><br>BLESS 一下<br><br><img src ="http://www.cppblog.com/Victordu/aggbug/59378.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Victordu/" target="_blank">Victordu</a> 2008-08-19 20:47 <a href="http://www.cppblog.com/Victordu/archive/2008/08/19/59378.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>POJ 2959 简单几何</title><link>http://www.cppblog.com/Victordu/archive/2008/08/19/59321.html</link><dc:creator>Victordu</dc:creator><author>Victordu</author><pubDate>Tue, 19 Aug 2008 03:15:00 GMT</pubDate><guid>http://www.cppblog.com/Victordu/archive/2008/08/19/59321.html</guid><wfw:comment>http://www.cppblog.com/Victordu/comments/59321.html</wfw:comment><comments>http://www.cppblog.com/Victordu/archive/2008/08/19/59321.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Victordu/comments/commentRss/59321.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Victordu/services/trackbacks/59321.html</trackback:ping><description><![CDATA[题意就是在轴承里面放珠子 给出轴承和珠子的直径 还有珠子的间距 问 最多可以放多少颗<br><br>oh yeah 又是一道水题 把大圆圆心和两个小圆圆心连接起来就比较容易看了<br><br>#include &lt;stdio.h&gt;<br>#include &lt;math.h&gt;<br><br>int main()<br>{<br>&nbsp;&nbsp;&nbsp; int t;<br>&nbsp;&nbsp;&nbsp; double D,d,s;<br>&nbsp;&nbsp;&nbsp; scanf("%d",&amp;t);<br>&nbsp;&nbsp;&nbsp; while(t--)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; scanf("%lf%lf%lf",&amp;D,&amp;d,&amp;s);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int m=0;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m=(int)(acos(-1)/asin((d+s)/(D-d)));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf("%d\n",m);<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br><br> <img src ="http://www.cppblog.com/Victordu/aggbug/59321.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Victordu/" target="_blank">Victordu</a> 2008-08-19 11:15 <a href="http://www.cppblog.com/Victordu/archive/2008/08/19/59321.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>POJ 2492 并查集</title><link>http://www.cppblog.com/Victordu/archive/2008/08/18/59275.html</link><dc:creator>Victordu</dc:creator><author>Victordu</author><pubDate>Mon, 18 Aug 2008 13:29:00 GMT</pubDate><guid>http://www.cppblog.com/Victordu/archive/2008/08/18/59275.html</guid><wfw:comment>http://www.cppblog.com/Victordu/comments/59275.html</wfw:comment><comments>http://www.cppblog.com/Victordu/archive/2008/08/18/59275.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/Victordu/comments/commentRss/59275.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Victordu/services/trackbacks/59275.html</trackback:ping><description><![CDATA[这个题好邪恶。。。<br>给的就是n个虫子 m对虫子发生过关系 然后问有没有虫子是同性恋。。。<br><br>用并查集作的 根据他们发生关系来建树－ －！<br>对虫子分情况讨论<br>如果是同一棵树 相距层数为偶数 那就是同性恋<br>如果是不同树 如果两只虫子是异性 那就合并 否则就根据层数大小对虫子和另一只虫子的父结点合并<br><br><img src ="http://www.cppblog.com/Victordu/aggbug/59275.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Victordu/" target="_blank">Victordu</a> 2008-08-18 21:29 <a href="http://www.cppblog.com/Victordu/archive/2008/08/18/59275.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>POJ 2524第一个并查集</title><link>http://www.cppblog.com/Victordu/archive/2008/08/18/59263.html</link><dc:creator>Victordu</dc:creator><author>Victordu</author><pubDate>Mon, 18 Aug 2008 11:41:00 GMT</pubDate><guid>http://www.cppblog.com/Victordu/archive/2008/08/18/59263.html</guid><wfw:comment>http://www.cppblog.com/Victordu/comments/59263.html</wfw:comment><comments>http://www.cppblog.com/Victordu/archive/2008/08/18/59263.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Victordu/comments/commentRss/59263.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Victordu/services/trackbacks/59263.html</trackback:ping><description><![CDATA[并查集的入门题目 阿 为什么又是一道水题。。。。<br><br>void make_set(int x)<br>{<br>&nbsp;&nbsp;&nbsp; p[x]=x;<br>&nbsp;&nbsp;&nbsp; rank[x]=0;<br>}<br><br>int find_set(int x)<br>{<br>&nbsp;&nbsp;&nbsp; if(x==p[x]) return x;<br>&nbsp;&nbsp;&nbsp; else p[x]=find_set(p[x]);<br>}<br><br><br>void union_set(int x,int y)<br>{<br>&nbsp;&nbsp;&nbsp; x=find_set(x);<br>&nbsp;&nbsp;&nbsp; y=find_set(y);<br>&nbsp;&nbsp;&nbsp; if(rank[x]&gt;rank[y]) p[y]=x;<br>&nbsp;&nbsp;&nbsp; else <br>&nbsp;&nbsp;&nbsp; &nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; p[x]=y;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; if(rank[x]==rank[y]) rank[y]++;<br>&nbsp;&nbsp;&nbsp; &nbsp; }&nbsp;&nbsp;&nbsp; <br>}<br><br><br><img src ="http://www.cppblog.com/Victordu/aggbug/59263.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Victordu/" target="_blank">Victordu</a> 2008-08-18 19:41 <a href="http://www.cppblog.com/Victordu/archive/2008/08/18/59263.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>POJ 2366 HASH</title><link>http://www.cppblog.com/Victordu/archive/2008/08/18/59240.html</link><dc:creator>Victordu</dc:creator><author>Victordu</author><pubDate>Mon, 18 Aug 2008 08:49:00 GMT</pubDate><guid>http://www.cppblog.com/Victordu/archive/2008/08/18/59240.html</guid><wfw:comment>http://www.cppblog.com/Victordu/comments/59240.html</wfw:comment><comments>http://www.cppblog.com/Victordu/archive/2008/08/18/59240.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/Victordu/comments/commentRss/59240.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Victordu/services/trackbacks/59240.html</trackback:ping><description><![CDATA[题意就是两组数中找是否有一对数的和等于10000<br>HASH来作 因为数据量不大<br>大的话可以用一下二分<br><br>恩 继续刷水题<br><br><img src ="http://www.cppblog.com/Victordu/aggbug/59240.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Victordu/" target="_blank">Victordu</a> 2008-08-18 16:49 <a href="http://www.cppblog.com/Victordu/archive/2008/08/18/59240.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>POJ 3267 拓扑排序</title><link>http://www.cppblog.com/Victordu/archive/2008/08/18/59232.html</link><dc:creator>Victordu</dc:creator><author>Victordu</author><pubDate>Mon, 18 Aug 2008 08:13:00 GMT</pubDate><guid>http://www.cppblog.com/Victordu/archive/2008/08/18/59232.html</guid><wfw:comment>http://www.cppblog.com/Victordu/comments/59232.html</wfw:comment><comments>http://www.cppblog.com/Victordu/archive/2008/08/18/59232.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Victordu/comments/commentRss/59232.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Victordu/services/trackbacks/59232.html</trackback:ping><description><![CDATA[恩 就是一个拓扑排序 我又做了一道水题。。。<br><img src ="http://www.cppblog.com/Victordu/aggbug/59232.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Victordu/" target="_blank">Victordu</a> 2008-08-18 16:13 <a href="http://www.cppblog.com/Victordu/archive/2008/08/18/59232.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>POJ 2502 FLOYD</title><link>http://www.cppblog.com/Victordu/archive/2008/08/18/59215.html</link><dc:creator>Victordu</dc:creator><author>Victordu</author><pubDate>Mon, 18 Aug 2008 06:15:00 GMT</pubDate><guid>http://www.cppblog.com/Victordu/archive/2008/08/18/59215.html</guid><wfw:comment>http://www.cppblog.com/Victordu/comments/59215.html</wfw:comment><comments>http://www.cppblog.com/Victordu/archive/2008/08/18/59215.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/Victordu/comments/commentRss/59215.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Victordu/services/trackbacks/59215.html</trackback:ping><description><![CDATA[这题是说 起点 终点 然后有若干条线路 线路上有若干点 求起点到终点最短路<br>稍稍建模一下 同线路上的点距离是其他点对距离的四分之一<br>用DIJ或者FLOYD求一下就OK了<br>输入处理有一点小麻烦<br><img src ="http://www.cppblog.com/Victordu/aggbug/59215.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Victordu/" target="_blank">Victordu</a> 2008-08-18 14:15 <a href="http://www.cppblog.com/Victordu/archive/2008/08/18/59215.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>