经典算法
文章平均质量分 78
BDF、BFS、贪心、二分查找等常用算法
goodluckwj
努力就会有回报
展开
-
hdu1051 Wooden Sticks 【贪心+java】
Wooden Sticks Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 25552Accepted Submission(s): 10348 Problem Description ...原创 2018-08-30 21:56:38 · 478 阅读 · 0 评论 -
nyoj 364田忌赛马(贪心)
田忌赛马时间限制:3000 ms | 内存限制:65535 KB难度:3描述Here is a famous story in Chinese history."That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse...原创 2017-03-24 22:09:29 · 338 阅读 · 0 评论 -
Gym 100187F (贪心+覆盖)
Doomsday comes in t units of time. In anticipation of such a significant event n people prepared m vaults in which, as they think, it will be possible to survive. But each vault can accommodate only k...原创 2017-03-23 13:02:18 · 338 阅读 · 0 评论 -
codeforces 777 BGame of Credit Cards(贪心)
B. Game of Credit Cardstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter the fourth season Sherlock and Moriary have realize...原创 2017-02-25 20:11:49 · 306 阅读 · 0 评论 -
codeforces 500C New Year Book Reading (贪心+思维)
C. New Year Book Readingtime limit per test2 secondsmemory limit per test256 megabytesNew Year is coming, and Jaehyun decided to read many books during 2015, unlike this year. He hasn boo...原创 2016-09-26 20:25:03 · 447 阅读 · 0 评论 -
LightOJ 1189 - Sum of Factorials(贪心+阶乘)
DescriptionGiven an integer n, you have to find whether it can be expressed as summation of factorials. For given n, you have to report a solution such thatn = x1! + x2! + ... + xn! (xi < xj fo...原创 2016-09-05 14:26:15 · 212 阅读 · 0 评论 -
Doing Homework again(贪心)
Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in ...原创 2016-07-23 16:44:00 · 280 阅读 · 0 评论 -
餐馆 牛客网 【贪心+二分】
热度指数:24039 时间限制:1秒 空间限制:65536K 某餐馆有n张桌子,每张桌子有一个参数:a 可容纳的最大人数; 有m批客人,每批客人有两个参数:b人数,c预计消费金额。 在不允许拼桌的情况下,请实现一个算法选择其中一部分客人,使得总预计消费金额最大输入描述:输入包括m+2行。 第一行两个整数n(1 <= n <= 50000),m(1 <= m...原创 2018-08-18 17:12:17 · 446 阅读 · 0 评论 -
LightOJ 1138 Trailing Zeroes (二分+阶乘分解+思维)
1138 - Trailing Zeroes (III) PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB You task is to find minimal natural number N, so that N! contains exactly Q ze...原创 2016-08-23 20:49:27 · 191 阅读 · 0 评论 -
Expanding Rods
DescriptionWhen a thin rod of length L is heated n degrees, it expands to a new length L' = (1+n*C)*L, where C is the coefficient of heat expansion.When a thin rod is mounted on two solid walls ...原创 2016-07-27 16:29:19 · 204 阅读 · 0 评论 -
Can you solve this equation?(二分)
Problem DescriptionNow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky. InputThe first line of the input conta...原创 2016-07-26 10:58:49 · 240 阅读 · 0 评论 -
poj 3197 Backward Digit Sums(DFS+穷举)
Backward Digit SumsTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 4487 Accepted: 2575 DescriptionFJ and his cows enjoy playing a mental game. They write down the...原创 2017-03-14 18:59:03 · 215 阅读 · 0 评论 -
codeforces 750D New Year and Fireworks(DFS)
D. New Year and Fireworkstime limit per test2.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne tradition of welcoming the New Year is launching ...原创 2017-02-21 12:50:24 · 289 阅读 · 0 评论 -
codeforces 510.B Fox And Two Dots (DFS好题)
B. Fox And Two Dotstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel is playing a mobile puzzle game called "Two Dots"...原创 2016-08-15 17:13:38 · 283 阅读 · 0 评论 -
zzulioj:1908: 小火山的围棋梦想(BFS)
1908: 小火山的围棋梦想Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 369 Solved: 107Description 小火山最近喜欢上了围棋。 对于围棋,其实小火山是一窍不通的。现在棋盘上,有很多小火山的棋子。 如果棋盘上有这样的一个位置, 那么这个位置也会变成小火山的棋子;这样的位置是指小火山的棋子将该位置围起来。...原创 2016-08-11 16:09:30 · 416 阅读 · 0 评论 -
zzuliOJ 1907:小火山的宝藏收益(链表+DFS)
1907: 小火山的宝藏收益Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 151 Solved: 41Description 进去宝藏后, 小火山发现宝藏有N个房间,且这n个房间通过N-1道门联通。 每一个房间都有一个价值为Ai的宝藏, 但是每一个房间也都存在一个机关。如果小火山取走了这个房间的宝藏,那么这个房间通往其...原创 2016-08-11 11:21:19 · 330 阅读 · 0 评论 -
hdu 1242 Rescue(BFS)(犯晕)
Problem DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison.Ang...原创 2016-07-29 17:23:38 · 242 阅读 · 0 评论 -
hdu Oil Deposits(DFS)
Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a...原创 2016-07-29 08:42:18 · 222 阅读 · 0 评论 -
hdu 1181 变形课(DFS)
Problem Description呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语是以a开头b结尾的一个单词,那么它的作用就恰好是使A物体变成B物体.Harry已经将他所会的所有咒语都列成了一个表,他想让你帮忙计算一下他是否能完成老师的作业,将一个B(ball...原创 2016-07-28 20:51:08 · 209 阅读 · 0 评论 -
NYOJ 58-最少步数【java版DFS&&BFS】
描述这有一个迷宫,有0~8行和0~8列:1,1,1,1,1,1,1,1,11,0,0,1,0,0,1,0,11,0,0,1,1,0,0,0,11,0,1,0,1,1,0,1,11,0,0,0,0,1,0,0,11,1,0,1,0,1,0,0,11,1,0,1,0,1,0,0,11,1,0,1,0,0,0,0,11,1,1,1,1,1,1,1,10表示道...原创 2018-08-18 11:00:07 · 500 阅读 · 0 评论