
算法
文章平均质量分 77
算法
千摆渡w
这个作者很懒,什么都没留下…
展开
-
poj-1651 multiplication puzzle(区间dp)
Time limit1000 msMemory limit65536 kBThe multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and...原创 2018-08-18 23:28:00 · 73 阅读 · 0 评论 -
poj-1979 red and black(搜索)
Time limit1000 msMemory limit30000 kBThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can mov...原创 2018-08-18 23:37:00 · 91 阅读 · 0 评论 -
Hard problem CodeForces - 706C
Time limit1000 msMemory limit262144 kB题目:Vasiliy is fond of solving different tasks. Today he found one he wasn't able to solve himself, so he asks you to help.Vasiliy is givennstrings cons...原创 2018-08-18 23:33:00 · 143 阅读 · 0 评论 -
hdu-1231 连续最大子序列(动态规划)
Time limit1000 msMemory limit32768 kB给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ...,Nj },其中 1 <= i <= j <= K。最大连续子序列是所有连续子序列中元素和最大的一个,例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续...原创 2018-08-18 23:04:00 · 71 阅读 · 0 评论 -
hdu-2063 过山车(二分图)
Time limit1000 msMemory limit32768 kBRPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把,Rabbit只愿意和XHD或PQK做partner,Grass只愿意和linle或L...原创 2018-08-18 22:51:00 · 69 阅读 · 0 评论 -
poj-2488 a knight's journey(搜索题)
Time limit1000 msMemory limit65536 kBBackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a journeyaround the world. Whenev...原创 2018-08-18 22:56:00 · 110 阅读 · 0 评论 -
hdu-2553 N皇后问题(搜索题)
在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。Output共有若干行,每行一个正整数,表示对应输入行的皇后的不同放置数量。Sample Input1...原创 2018-08-18 21:40:00 · 125 阅读 · 0 评论 -
poj-2386 lake counting(搜索题)
Time limit1000 msMemory limit65536 kBDue to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M...原创 2018-08-18 22:48:00 · 125 阅读 · 0 评论 -
hdu-1874 畅通工程续(最短路)
Time limit1000 msMemory limit32768 kB某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题目包含多组数据,请处理到文件...原创 2018-08-18 22:43:00 · 63 阅读 · 0 评论 -
hdu-2544 最短路(最短路)
Time limit1000 msMemory limit32768 kB在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=100...原创 2018-08-18 22:40:00 · 78 阅读 · 0 评论 -
poj-1011 sticks(搜索题)
George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks he had...原创 2018-08-18 21:58:00 · 108 阅读 · 0 评论 -
poj-1182 食物链(并查集)
Time limit1000 msMemory limit10000 kB动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说法是"2 ...原创 2018-08-18 22:35:00 · 67 阅读 · 0 评论 -
poj-1700 crossing river(贪心题)
题目描述:A group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement must be arranged in order to row the boat...原创 2018-08-18 21:24:00 · 113 阅读 · 0 评论 -
poj-2236 wireless network(并查集)
An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in ...原创 2018-08-18 21:29:00 · 76 阅读 · 0 评论 -
poj-3278 catch that cow(搜索题)
题目描述:Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a pointN(0 ≤N≤ 100,000) on a number line and the cow is at a pointK(0...原创 2018-08-18 21:13:00 · 75 阅读 · 0 评论 -
poj-3253 fence repair(贪心题)
题目描述:Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needsN(1 ≤N≤ 20,000) planks of wood, each having some integer length...原创 2018-08-18 21:04:00 · 78 阅读 · 0 评论 -
poj-2524 ubiquitous religions(并查集)
Time limit5000 msMemory limit65536 kBThere are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many differen...原创 2018-08-18 22:15:00 · 83 阅读 · 0 评论 -
hdu-1338 game predictions(贪心题)
Suppose there are M people, including you, playing a special card game. At the beginning, each player receives N cards. The pip of a card is a positive integer which is at most N*M. And there are...原创 2018-08-18 22:10:00 · 146 阅读 · 0 评论 -
hihocoder1175 拓扑排序2
#1175 : 拓扑排序·二时间限制:10000ms单点时限:1000ms内存限制:256MB描述小Hi和小Ho所在学校的校园网被黑客入侵并投放了病毒。这事在校内BBS上立刻引起了大家的讨论,当然小Hi和小Ho也参与到了其中。从大家各自了解的情况中,小Hi和小Ho整理得到了以下的信息:校园网主干是由N个节点(编号1..N)组成,这些节点之间有一些单向的网路连接...原创 2018-08-19 10:35:00 · 88 阅读 · 0 评论 -
Stall Reservations POJ - 3190 (贪心+优先队列)
Stall ReservationsTime Limit:1000MSMemory Limit:65536KTotal Submissions:11002Accepted:3886Special JudgeDescriptionOh those picky N (1 <= N <= 50,000) cows! They a...原创 2018-08-19 09:59:00 · 85 阅读 · 0 评论 -
Find a way HDU - 2612(bfs)
Find a wayTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23967Accepted Submission(s): 7823Problem DescriptionPass a year learning i...原创 2018-08-19 10:03:00 · 91 阅读 · 0 评论 -
Virtual Friends HDU - 3172 (并查集+秩+map)
These days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people, growing their social network (their friends, their friends' ...原创 2018-08-19 10:28:00 · 98 阅读 · 0 评论 -
AreYouBusy HDU - 3535 (dp)
AreYouBusyTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5176Accepted Submission(s): 2069Problem DescriptionHappy New Term!As havin...原创 2018-08-19 10:24:00 · 106 阅读 · 0 评论 -
Divisibility by 25 CodeForces - 988E
You are given an integernnfrom11to10181018without leading zeroes.In one move you can swap any two adjacent digits in the given number in such a way that the resulting number will not conta...原创 2018-08-19 10:15:00 · 82 阅读 · 0 评论 -
Jack Straws POJ - 1127 (几何计算)
Jack StrawsTime Limit:1000MSMemory Limit:10000KTotal Submissions:5428Accepted:2461DescriptionIn the game of Jack Straws, a number of plastic or wooden "straws" are dumped ...原创 2018-08-19 10:21:00 · 88 阅读 · 0 评论 -
逃离迷宫 HDU - 1728(bfs)
逃离迷宫Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 34147Accepted Submission(s): 8333Problem Description 给定一个m × n (m行, n列)的迷宫,迷宫中有...原创 2018-08-19 10:12:00 · 87 阅读 · 0 评论 -
Three displays CodeForces - 987C (dp)
C. Three displaystime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt is the middle of 2018 and Maria Stepanovna, who lives outs...原创 2018-08-19 09:55:00 · 123 阅读 · 0 评论 -
Radar Installation POJ - 1328(贪心)
Radar InstallationTime Limit:1000MSMemory Limit:10000KTotal Submissions:107553Accepted:23886DescriptionAssume the coasting is an infinite straight line. Land is in one sid...原创 2018-08-19 09:52:00 · 79 阅读 · 0 评论 -
Seven Puzzle Aizu - 0121 (搜索)
7 パズルime limit1000 msMemory limit131072 kBOSLinuxSource3rd PC Koshien, Final7 パズルは 8 つの正方形のカードとこれらのカードがぴたりと収まる枠で構成されています。それぞれのカードには、互いに区別できるように 0, 1, 2, ..., 7 と番号がつけられています。枠には、縦に 2 個、横に 4 個...原创 2018-08-19 09:43:00 · 79 阅读 · 0 评论 -
Meteor Shower POJ - 3669 (bfs+优先队列)
Meteor ShowerTime Limit:1000MSMemory Limit:65536KTotal Submissions:26455Accepted:6856DescriptionBessie hears that an extraordinary meteor shower is coming; reports say th...原创 2018-08-19 09:40:00 · 81 阅读 · 0 评论 -
二分
Letters CodeForces - 978C题意:n个寝室,每个寝室多个房间(1-a[i]),一共m封信只知道房间号,现在要求把信送到第几个寝室的第几个房间里去,房间号从第一个寝室到第n个寝室的第一个房间到最后一个房间排下去题意:用个二分查找吧,省点时间,二分才658ms,爆搜1600多ms#include<cstdio>#include<iostre...原创 2018-08-19 09:37:00 · 77 阅读 · 0 评论 -
poj3617 best cow line(贪心题)
Best Cow LineTime Limit:1000MSMemory Limit:65536KTotal Submissions:32687Accepted:8660DescriptionFJ is about to take hisN(1 ≤N≤ 2,000) cows to the annual"Farmer of the...原创 2018-08-19 09:47:00 · 83 阅读 · 0 评论 -
Nastya Studies Informatics CodeForces - 992B (大整数)
B. Nastya Studies Informaticstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputToday on Informatics class Nastya learned about G...原创 2018-08-19 09:31:00 · 91 阅读 · 0 评论 -
Cheese Aizu - 0558 (搜索题)
Time limit8000 msMemory limit131072 kBチーズ ()問題今年も JOI 町のチーズ工場がチーズの生産を始め,ねずみが巣から顔を出した.JOI 町は東西南北に区画整理されていて,各区画は巣,チーズ工場,障害物,空き地のいずれかである.ねずみは巣から出発して全てのチーズ工場を訪れチーズを 1 個ずつ食べる.この町には,N 個のチーズ工場があり,...原创 2018-08-19 09:27:00 · 89 阅读 · 0 评论 -
poj-3009 curling2.0(搜索)
Curling 2.0Time Limit:1000MSMemory Limit:65536KTotal Submissions:26408Accepted:10546DescriptionOn Planet MM-21, after their Olympic games this year, curling is getting po...原创 2018-08-18 23:49:00 · 71 阅读 · 0 评论 -
aoj-0118 property distribution(搜索)
Time limit1000 msMemory limit131072 kBタナカ氏がHWアールの果樹園を残して亡くなりました。果樹園は東西南北方向にH × Wの区画に分けられ、区画ごとにリンゴ、カキ、ミカンが植えられています。タナカ氏はこんな遺言を残していました。果樹園は区画単位でできるだけ多くの血縁者に分けること。ただし、ある区画の東西南北どれかの方向にとなりあう区画に...原创 2018-08-18 23:40:00 · 80 阅读 · 0 评论 -
Statues CodeForces - 129C(bfs)
In this task Anna and Maria play a game with a very unpleasant rival. Anna and Maria are in the opposite squares of a chessboard (8 × 8): Anna is in the upper right corner, and Maria is in the lo...原创 2018-08-19 10:32:00 · 124 阅读 · 0 评论 -
Cleaning Shifts POJ - 2376 (贪心题)
Cleaning ShiftsTime Limit:1000MSMemory Limit:65536KTotal Submissions:31194Accepted:7677DescriptionFarmer John is assigning some of his N (1 <= N <= 25,000) cows to d...原创 2018-08-19 09:50:00 · 73 阅读 · 0 评论 -
Dungeon Master POJ - 2251 (搜索)
Dungeon MasterTime Limit:1000MSMemory Limit:65536KTotal Submissions:48605Accepted:18339DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out...原创 2018-08-29 21:53:00 · 57 阅读 · 0 评论 -
Dire Wolf HDU - 5115(区间dp)
Dire WolfTime Limit: 5000/5000 MS (Java/Others)Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 3815Accepted Submission(s): 2266Problem DescriptionDire wolves, also know...原创 2018-08-22 11:04:00 · 88 阅读 · 0 评论