摘要: 传送门Time Limit: 3000MSDescriptionThere is a magic planet in the space. There is a magical country on the planet. There are N cities in the country. The... 阅读全文
posted @ 2015-10-13 09:36 Pat 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 传送门 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Description A school bought the first computer some time ago(so this computer 阅读全文
posted @ 2015-10-13 08:53 Pat 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 这篇随笔是对算法导论(Introduction to Algorithms, 3rd. Ed.)第26章 Maximum Flow的摘录。 1. A flow network $G = (V, E )$ is a directed graph in which each edge $(u, v) \ 阅读全文
posted @ 2015-10-10 13:56 Pat 阅读(341) 评论(0) 推荐(0) 编辑
摘要: 1. 在printf()的参数前加& (2015/10/7) 这是我写的一个数据生成器(generator)片段 阅读全文
posted @ 2015-10-08 00:16 Pat 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 传送门 时间限制:10000ms 单点时限:5000ms 内存限制:256MB 时间限制:10000ms 单点时限:5000ms 内存限制:256MB 描述 你正在和小冰玩一个猜数字的游戏。小冰首先生成一个长为N的整数序列 $A_1, A_2, \dots , A_N$。在每一轮游戏中,小冰会给出一 阅读全文
posted @ 2015-10-03 14:49 Pat 阅读(389) 评论(0) 推荐(0) 编辑
摘要: 传送门 A set of n 1-dimensional items have to be packed in identical bins. All bins have exactly the same length l and each item i has length li ≤ l. We 阅读全文
posted @ 2015-09-27 21:45 Pat 阅读(344) 评论(0) 推荐(0) 编辑
摘要: (这是C++系列随笔的第二篇,这一系列是我练习C++而查的资料) extracted from C++ Primer 5th. edition pp. 425 Using a Comparison for the Key Type The type of the operation that a c 阅读全文
posted @ 2015-09-23 00:44 Pat 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 这篇随笔是The C++ Programming Language Fourth Edition, by Bjarne Stroustrup 第33章STL Iterators的摘录。 1 Introduction This chapter presents the STL interators a 阅读全文
posted @ 2015-09-23 00:14 Pat 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 传送门POUR1 - Pouring water#gcd#recursionGiven two vessels, one of which can accommodatealitres of water and the other -blitres of water, determine the n... 阅读全文
posted @ 2015-09-21 00:30 Pat 阅读(389) 评论(0) 推荐(0) 编辑
摘要: Problem 给出一个不带边权(即边权为1)的有向无环图(unweighted DAG)以及DAG上两点s, t,求s到t的最短距离,如果无法从s走到t,则输出-1。 Solution DFS,BFS都可,对于unweighted DAG, BFS更合适,下面给出DFS解法。 对于weighted 阅读全文
posted @ 2015-09-19 22:47 Pat 阅读(369) 评论(0) 推荐(0) 编辑