
北大暑期学校
文章平均质量分 84
Megumin
这个作者很懒,什么都没留下…
展开
-
OpenJudge 海贼王之伟大航路 DFS+状态压缩
描述“我是要成为海贼王的男人!”,路飞一边喊着这样的口号,一边和他的伙伴们一起踏上了伟大航路的艰险历程。路飞他们伟大航路行程的起点是罗格镇,终点是拉夫德鲁(那里藏匿着“唯一的大秘宝”——ONE PIECE)。而航程中间,则是各式各样的岛屿。因为伟大航路上的气候十分异常,所以来往任意两个岛屿之间的时间差别很大,从A岛到B岛可能需要1天,而从B岛到A岛则可能需要1年。当然,任意两个原创 2016-07-20 22:48:18 · 1185 阅读 · 0 评论 -
Poj1611 The Suspects 并查集基础题
DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best s原创 2016-07-22 00:17:34 · 368 阅读 · 0 评论 -
Poj3468 A Simple Problem with Integers 线段树、区间更新
DescriptionYou have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is原创 2016-07-21 23:35:07 · 293 阅读 · 0 评论 -
Poj3264 Balanced Lineup 线段树基础题
DescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows.原创 2016-07-21 21:01:32 · 312 阅读 · 0 评论 -
OpenJudge 迷宫问题 BFS
描述定义一个二维数组: int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线输入一个5 × 5的二维原创 2016-07-21 12:31:43 · 550 阅读 · 0 评论 -
POJ3278 Catch That Cow BFS入门
DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K原创 2016-07-21 10:56:07 · 326 阅读 · 0 评论 -
Poj1321 棋盘问题 DFS
Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n原创 2016-07-20 23:35:03 · 343 阅读 · 0 评论 -
POJ1164 The Castle DFS
Description 1 2 3 4 5 6 7 ############################# 1 # | # | # | | # #####---#####---#---#####---# 2 # # | # # # # # #---#####-原创 2016-07-19 19:26:55 · 388 阅读 · 0 评论 -
POJ1390 Blocks 区间DP
DescriptionSome of you may have played a game called 'Blocks'. There are n blocks in a row, each box has a color. Here is an example: Gold, Silver, Silver, Silver, Silver, Bronze, Bronze, Bronze,原创 2016-07-18 23:55:11 · 579 阅读 · 0 评论 -
POJ3624 Charm Bracelet 01背包裸题
DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each原创 2016-07-18 18:57:36 · 443 阅读 · 0 评论 -
POJ1088 滑雪
DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 516 17 18 19 615 24 25 20 7原创 2016-07-18 20:08:03 · 247 阅读 · 0 评论 -
POJ1163 The Triangle
Description73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that原创 2016-07-18 18:27:08 · 225 阅读 · 0 评论 -
POJ1458 Common Subsequence 最长公共子序列
DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exists a原创 2016-07-18 18:41:34 · 289 阅读 · 0 评论 -
POJ1569 Myacm Triangles 判断点与三角形的关系
DescriptionThere has been considerable archeological work on the ancient Myacm culture. Many artifacts have been found in what have been called power fields: a fairly small area, less than 100原创 2016-07-28 11:06:50 · 474 阅读 · 0 评论 -
POJ2349 Arctic Network Prim+堆(优先队列)、Kruskal(并查集)
DescriptionThe Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the n原创 2016-07-26 18:28:00 · 435 阅读 · 0 评论 -
POJ1789 Truck History Prim+堆(优先队列)、Kruskal(并查集)
DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describing ea原创 2016-07-26 20:06:13 · 505 阅读 · 0 评论 -
Poj1190 生日蛋糕 DFS
#include #include #include #include #include #include #include #include #include #include using namespace std;#define INF 0x3f3f3f3ftypedef long long LL;int n,m,sum;int ans=INF;int minv原创 2016-07-22 11:59:27 · 404 阅读 · 0 评论 -
Poj1308 Is It A Tree? 并查集
DescriptionA tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following prop原创 2016-07-22 10:32:57 · 575 阅读 · 0 评论