![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
oj
文章平均质量分 78
type_q
这个作者很懒,什么都没留下…
展开
-
HDOJ 1074-Doing Homework
之前见到这道题时没像出来怎么写,今天在网上搜了一下,发现了一个名词-状态压缩的动态规划。在这个题里的状态压缩的表现形式就是用二进制表示已选集合,这样做就可以用动态规划来解这种解空间为排序树的题了,之前见过几道这种题,都卡在如何表示已选集合上面。收获不小。#includeint dp[1 << 16], end[1 << 16], back[1 << 16];int d[16], c[16];原创 2014-04-22 19:58:46 · 548 阅读 · 0 评论 -
拓展欧几里得算法
感觉自己搞懂这个算法了,记录一下。原创 2014-04-25 10:40:07 · 681 阅读 · 2 评论 -
[Code Jam] Millionaire
Problem C. MillionaireThis contest is open for practice. You can try every problem as many times as you like, though we won't keep track of which problems you solve. Read the Quick-Start Gui原创 2014-04-27 11:08:16 · 606 阅读 · 0 评论 -
[Code Jam] Crazy Rows
ProblemYou are given an N x N matrix with 0 and 1 values. You can swap any two adjacent rows of the matrix.Your goal is to have all the 1 values in the matrix below or on the main diagonal. That i原创 2014-04-27 10:02:00 · 600 阅读 · 0 评论 -
[Code Jam] Bribe the Prisoners
ProblemIn a kingdom there are prison cells (numbered 1 to P) built to form a straight line segment. Cells number i and i+1 are adjacent, and prisoners in adjacent cells are called "neighbours." A原创 2014-04-28 20:11:37 · 783 阅读 · 0 评论