<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[justhereforstudy的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/justhereforstudy</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; justhereforstudy]]></copyright><item><title><![CDATA[POJ-3254（状压dp）]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375429</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375429</guid><author>justhereforstudy</author><pubDate>Tue, 16 Aug 2022 22:13:10 +0800</pubDate><description><![CDATA[【代码】POJ-3254（状压dp）]]></description><category></category></item><item><title><![CDATA[ZOJ-3471（状压dp）]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375384</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375384</guid><author>justhereforstudy</author><pubDate>Tue, 16 Aug 2022 22:09:37 +0800</pubDate><description><![CDATA[【代码】ZOJ-3471（状压dp）]]></description><category></category></item><item><title><![CDATA[POJ-3311（状压dp）]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375333</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375333</guid><author>justhereforstudy</author><pubDate>Tue, 16 Aug 2022 22:05:53 +0800</pubDate><description><![CDATA[【代码】POJ-3311（状压dp）]]></description><category></category></item><item><title><![CDATA[洛谷-P1896（状压dp）]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375229</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375229</guid><author>justhereforstudy</author><pubDate>Tue, 16 Aug 2022 21:58:37 +0800</pubDate><description><![CDATA[【代码】洛谷-P1896（状压dp）]]></description><category></category></item><item><title><![CDATA[POJ-2441（状压dp）]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375190</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375190</guid><author>justhereforstudy</author><pubDate>Tue, 16 Aug 2022 21:56:04 +0800</pubDate><description><![CDATA[【代码】POJ-2441（状压dp）]]></description><category></category></item><item><title><![CDATA[CodeForces-580D（状压dp）]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375121</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375121</guid><author>justhereforstudy</author><pubDate>Tue, 16 Aug 2022 21:52:06 +0800</pubDate><description><![CDATA[【代码】CodeForces-580D（状压dp）]]></description><category></category></item><item><title><![CDATA[HDU-3001（旅行商问题+三进制状压dp）]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375033</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/126375033</guid><author>justhereforstudy</author><pubDate>Tue, 16 Aug 2022 21:45:30 +0800</pubDate><description><![CDATA[【代码】HDU-3001（旅行商问题+三进制状压dp）]]></description><category></category></item><item><title><![CDATA[HDU-5418（状压dp+Floyd）]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/126374960</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/126374960</guid><author>justhereforstudy</author><pubDate>Tue, 16 Aug 2022 21:40:52 +0800</pubDate><description><![CDATA[【代码】HDU-5418（状压dp+Floyd）]]></description><category></category></item><item><title><![CDATA[洛谷-P1171（状压dp）]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/126374854</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/126374854</guid><author>justhereforstudy</author><pubDate>Tue, 16 Aug 2022 21:34:21 +0800</pubDate><description><![CDATA[【代码】洛谷-P1171（状压dp）]]></description><category></category></item><item><title><![CDATA[AtCoder Beginner Contest 218 D - Rectangles]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/120244386</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/120244386</guid><author>justhereforstudy</author><pubDate>Sat, 11 Sep 2021 23:00:24 +0800</pubDate><description><![CDATA[题目大意
平面上有n个点，问你这n个点能组成多少个四条边都是平行于x轴或y轴的矩形。
思路
对这n个点排序，x小的在前，x相同的时候y小的在前。
然后对于所有xi，用map记录可能存在的边&lt;yi, yj&gt;的个数，很明显，xi相同的情况下，&lt;yi, yj&gt;是平行于y轴的，如果边&lt;yi, yj&gt; 的个数为m，那么能组成的矩形的个数为C(2m)\binom{2}{m}(m2​)，也可以直接理解成m-1 + m - 2 + … 3 + 2 + 1，即第一条边可以与其后面的m - ]]></description><category></category></item><item><title><![CDATA[AtCoder Beginner Contest 217 D - Cutting Woods（set + 二分查找）]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/120106950</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/120106950</guid><author>justhereforstudy</author><pubDate>Sat, 04 Sep 2021 22:46:24 +0800</pubDate><description><![CDATA[题目大意
有一根长度为L的木头，这根木头上有L - 1个可以劈的点，对这根木头进行q次操作，操作有两种：操作一是往一个可劈点劈一刀，把这个点所在的木头段劈成两段；操作二是输出一个可劈点所在木头段的长度。
思路
直接用一个set存操作一所劈的点，因为set保证了所劈的点是递增的，所以对于操作二，直接用lower_bound找到第一个比要找的可劈点大的已劈点，然后lower_bound找到的位置后退一位就是第一个比要找的可劈点小的已劈点，两者相减就是该可劈点所在木头段的长度。
因为存在set中第一个已劈点比操作]]></description><category></category></item><item><title><![CDATA[AtCoder Beginner Contest 216 D - Pair of Balls（搜索）]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/119986238</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/119986238</guid><author>justhereforstudy</author><pubDate>Sun, 29 Aug 2021 21:46:58 +0800</pubDate><description><![CDATA[题目大意：
有n种颜色，每种颜色有2个小球，现在将这2n个小球分别放到m个容器里，当两个容器的顶部小球颜色相同时，可以把这两个小球拿出容器，问可不可能把2n个小球从m个容器中拿出来。
思路：
因为每个容器的小球是满足先输入的先出容器的，所以用m个队列存每个容器里小球的情况。
用一个数组vis[ i ]记录当前第 i 种颜色的小球是否出现过在某个容器的顶部，再用一个map记录当前第 i 种颜色的小球第一次出现在哪个容器的顶部。
枚举每一个容器，如果容器 i 的顶部小球对应的颜色出现过，即vis[ ] = 1的]]></description><category></category></item><item><title><![CDATA[Codeforces Round #740 （Div. 2） B. Charmed by the Game]]></title><link>https://blog.youkuaiyun.com/justhereforstudy/article/details/119907710</link><guid>https://blog.youkuaiyun.com/justhereforstudy/article/details/119907710</guid><author>justhereforstudy</author><pubDate>Wed, 25 Aug 2021 11:47:22 +0800</pubDate><description><![CDATA[题目大意

两个人在打网球，两人轮流发球，有两种得分的情况，一个是自己发球的回合得分，叫做"holds"，另一种是在对方发球的回合得分，叫做"breaks"，现在给出比赛结束后两个人的得分，问你两个人总的"breaks"的次数有多少种情况。我们是不知道谁先发球，而且每一回合谁得分的，只知道两个人的最后得分。

思路
分两种情况，总的比赛回合sum为奇数或为偶数两种：
偶数比较好懂，先说偶数：
sum为偶数：
可以确定两个人发球的次数是相同的，所以谁先发球是不影响最后的答案的。
我们以分数少的人来看看，假设是]]></description><category></category></item></channel></rss>