随笔分类 - OJ-POJ
摘要:There is given the series of n closed intervals [ai; bi], where i=1,2,...,n. The sum of those intervals may be represented as a sum of closed pairwise
阅读全文
摘要:【题意建模】: 你想娶酋长的女儿,但酋长要求你给一定数额金钱的聘礼。除了金钱外,酋长也允许你用部落里其他人的某物品加上一点钱作为聘礼。而其他人的物品也可以通过指定的另外一些人的某物品加上一些金钱获得。部落里的每个人有一个等级。你的整个交易过程涉及的人的等级只能在一个限定的差值内。问你最少需要多少金钱
阅读全文
摘要:RK法:https://www.cnblogs.com/16crow/p/6879988.html #include<cstdio> #include<string> #include<cstdlib> #include<cmath> #include<iostream> #include<cstr
阅读全文
摘要:农夫约翰在探索他的许多农场,发现了一些惊人的虫洞。虫洞是很奇特的,因为它是一个单向通道,可让你进入虫洞的前达到目的地!他的N(1≤N≤500)个农场被编号为1..N,之间有M(1≤M≤2500)条路径,W(1≤W≤200)个虫洞。FJ作为一个狂热的时间旅行的爱好者,他要做到以下几点:开始在一个区域,
阅读全文
摘要:Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchang
阅读全文
摘要:Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whe
阅读全文
摘要:Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but
阅读全文
摘要:动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说
阅读全文
摘要:You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write
阅读全文
摘要:Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs you
阅读全文
摘要:The Unique MST Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 22668 Accepted: 8038 Description Given a connected undirected graph, tell if
阅读全文
摘要:Balanced Lineup Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 62103 Accepted: 29005 Case Time Limit: 2000MS Description For the daily mil
阅读全文
摘要:本题有写法好几个写法,但主要思路是BFS: No。1 采用双向宽搜,分别从起始态和结束态进行宽搜,暴力判重。如果只进行单向会超时。 No。2 采用hash进行判重,宽搜采用单向就可以AC。 No。3 运用康拓展开进行判重,即使采用单向宽搜时间效率也很高。 哈希是想到了,但是我们应该选择什么哈希函数呢
阅读全文
摘要:Shuffle'm Up Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14471 Accepted: 6633 Description A common pastime for poker players at a poker
阅读全文
摘要:Prime Path Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 26475 Accepted: 14555 Description The ministers of the cabinet were quite upset
阅读全文
摘要:Maya Calendar Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 82431 Accepted: 25319 Description During his last sabbatical, professor M. A.
阅读全文
摘要:Dungeon Master Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 45743 Accepted: 17256 Description You are trapped in a 3D dungeon and need t
阅读全文
摘要:1 2 3 4 5 6 7 1 | | | | 2 | 3 | | 4 | | | | (Figure 1) = Wall | = No wall = No wall Figure 1 shows the map of a castle.Write a program that calculates
阅读全文
摘要:迷宫问题 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 31428 Accepted: 18000 Description 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0,
阅读全文
摘要:棋盘问题 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 62164 Accepted: 29754 Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋
阅读全文