自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(42)
  • 收藏
  • 关注

原创 [POJ1655]Balancing Act

Consider a tree T with N (1 <= N <= 20,000) nodes numbered 1…N. Deleting any node from the tree yields a forest: a collection of one or more trees. Define the balance of a node to be

2015-09-16 21:11:05 255

原创 [POJ3342]Party at Hali-Bula

Dear Contestant,I’m going to have a party at my villa at Hali-Bula to celebrate my retirement from BCM. I wish I could invite all my co-workers, but imagine how an employee can enjoy

2015-09-16 16:33:46 259

原创 [UVa 1625]Color Length

Problem DescriptionMy Problem Report这是道非常值得总结的题。通过这道题我对两个概念的理解加深了很多: 无后效性原则 最优子结构 在做动态规划的时候,我们需要明白一点,就是当前状态一定是由过去的状态(也就是最优子结构)转移而来的,而不是说过去的状态影响了现在的状态。我们在对状态进行转移时,要充分意识到三点: 过去的状态一定是最优的,我们

2015-09-09 20:40:37 399

原创 [Codeforces Round #317]Order Book

In this task you need to process a set of stock exchange orders and use them to create order book.An order is an instruction of some participant to buy or sell stocks on stock exchange. T

2015-09-09 20:27:21 237

原创 [Codeforces Round #318]Bear and Elections

Problem DescriptionLimak is a grizzly bear who desires power and adoration. He wants to win in upcoming elections and rule over the Bearland.There are n candidates, including Limak. We know how many ci

2015-09-09 20:21:19 270

原创 [Codeforces Round #318]Bear and Three Musketeers

Problem DescritionDo you know a story about the three musketeers? Anyway, you will learn about its origins now.Richelimakieu is a cardinal in the city of Bearis. He is tired of dealing with crime by hi

2015-09-09 20:07:57 266

原创 [Codeforces Round #318]Bear and Poker

Limak is an old brown bear. He often plays poker with his friends. Today they went to a casino. There are n players (including Limak himself) and right now all of them have bids on t

2015-09-09 19:58:29 199

原创 [Codeforces Round #318 ]Bear and Blocks

Limak is a little bear who loves to play. Today he is playing by destroying block towers. He built n towers in a row. The i-th tower is made of hi identical blocks.

2015-09-09 19:51:11 289

原创 [UVa1331]Minimax Triangulation

[UVa1331]Minimax Triangulation

2015-08-19 20:16:56 311

原创 [UVa 1626]Brackets sequence

[UVa 1626]Brackets sequence

2015-08-19 13:02:19 422

原创 [UVa10003]Cutting Sticks

[UVa10003]Cutting Sticks

2015-08-18 23:19:53 258

原创 [UVa 1625]Color Length

[UVa 1625]Color Length

2015-08-18 20:55:01 183

原创 [UVa 11584]Partitioning by Palindromes

We say a sequence of char- acters is a palindrome if it is the same written forwards and backwards. For example, ‘racecar’ is a palindrome, but ‘fastcar’ is not.

2015-08-18 16:27:07 412

原创 [UVa 11400]Lighting System Design

Problem DescriptionYou are given the task to design a lighting system for a huge conference hall. After doing a lot of calculation and sketching, you have figured out the requirements for an energy-eff

2015-08-18 15:35:07 290

原创 Longest Commom Subsequences Problem

到网上参考了很多博客和资料,发现讲得都太复杂。反而是常被吐槽的《算法导论》讲得最清楚、明了。

2015-08-17 18:19:34 292

原创 [UVa 12563]Jin Ge Jin Qu hao

Problem Description(If you smiled when you see the title, this problem is for you ^_^) For those who don’t know KTV, see: http://en.wikipedia.org/wiki/Karaoke_box There is one very popular song calle

2015-08-17 16:15:51 292

原创 [UVa 116]Unidirectional TSP

Problem DescriptionProblems that require minimum paths through some domain appear in many different areas of computer science. For example, one of the constraints in VLSI routing problems is minimizing

2015-08-16 23:21:02 326

原创 [UVa 1347]Tour

Problem DescriptionJohn Doe, a skilled pilot, enjoys traveling. While on vacation, he rents a small plane and starts visiting beautiful places. To save money, John must determine the shortest closed to

2015-08-16 19:54:19 250

原创 [UVa 437]The Tower of Babylon

Perhaps you have heard of the legend of the Tower of Babylon. Nowadays many details of this tale have been forgotten. So now, in line with the educational nature of this contest, we

2015-08-15 20:28:48 288

原创 [UVa 1025]A Spy in the Metro

Secret agent Maria was sent to Algorithms City to carry out an especially dangerous mission. After several thrilling events we find her in the first station of Algorithms City Metro,

2015-08-15 16:39:13 232

原创 [Codeforces Round #316] Replacement

Problem DescriptionDaniel has a string s, consisting of lowercase English letters and period signs (characters ‘.’). Let’s define the operation of replacement as the following sequence of steps: find a

2015-08-14 16:57:30 473

原创 [UVa 10534]Wavio Sequence

Problem DescriptionWavio is a sequence of integers. It has some interesting properties. • Wavio is of odd length i.e. L = 2 ∗ n + 1. • The first (n + 1) integers of Wavio sequence makes a strictly in

2015-08-14 16:32:33 424

原创 Longest Increasing Subsequence

Longest Increasing Subsequence

2015-08-14 15:48:51 258

原创 [UVa 1394]And Then There Was One

Let’s play a stone removing game. Initially, n stones are arranged on a circle and numbered 1,…, n clockwise

2015-08-14 11:42:53 184

原创 Trailing Zeros

If 2001! were written in base 23,how many trailing zeros would there be?Problem Report

2015-08-13 09:59:32 257

原创 [UVa 10285]Longest Run on a Snowboard

Problem DescriptionMichael likes snowboarding. That’s not very surprising, since snowboarding is really great. The bad thing is that in order to gain speed, the area must slide downwards.

2015-08-12 20:24:02 388

原创 [UVa 10118]Free Candies

Problem DescriptionLittle Bob is playing a game. He wants to win some candies in it - as many as possible.

2015-08-12 20:13:13 270

原创 [UVa 1629]Cake Slicing

DescriptionA rectangular cake with a grid of m*n unit squares on its top needs to be sliced into pieces. Several cherries are scattered on the top of the cake with at most one cherry on a unit square.

2015-08-12 19:56:38 373

原创 [UVa 220]Othello

Problem DescriptionOthello is a game played by two people on an 8 x 8 board, using disks that are white on one side and black on the other. One player places disks with the white side up and the other

2015-07-19 22:01:32 200

ACdream1742 哗啦啦族的01背包问题

这道题是一个简化版的“超大背包问题”,一开始我试图用各种剪支或者启发式搜索来完成,最后都发现这个NPC问题的解空间太大了。不过因为这道题数据太水的原因,所以记忆化剪支其实是可以在很快的时间内AC的,但并不是在。我们来看一下这道题究竟应该如何优化。首先观察数据N最大为40,其实从这里就可以发现,如果我们将复杂度的量级缩小到2^20,指数级算法还是有希望通过的。于是我们将数据分为两段,一端先通

2015-06-10 20:34:55 98

原创 [FZU2195]检查站点

Problem Description在山上一共有N个站点需要检查,检查员从山顶出发去各个站点进行检查,各个站点间有且仅有一条通路,检查员下山前往站点时比较轻松,而上山时却需要额外的时间,问最后检查员检查完所有站点时所需要的额外时间最少是多少。Input包含多组数据 每组数据输入第一行为一个整数N 表示站点个数(1<=N<=100000),接下去N-1 行 每行3个整数 x,y,z(1<=z<=10

2015-05-04 01:49:15 316

原创 [ACdream]ACdream的高速公路

ACdream王国有一条贯穿整个王国的高速公路,一天,你要驾驶着一辆油箱容量为P的车从高速公路的一头驶向另一头,总路程为L千米,每单位体积的汽油可维持行驶W千米,显然路途遥远~总有不够油的情况,所以就要加油~! 再高速公路上总共有N个加油站,但是由于是不同人开的,因此定价也参差不齐。

2015-04-26 11:16:10 592

原创 [The 2015 Shanghai Invitational Programming Contest]Seam Carving

DescriptionFish likes to take photo with his friends. Several days ago, he found that some pictures of him were damaged. The trouble is that there are some seams across the pictures.

2015-04-26 10:54:21 398

原创 [POJ1806]Stripies

DescriptionOur chemical biologists have invented a new very useful form of life called stripies (in fact, they were first called in Russian - polosatiki, but the scientists had to invent an English nam

2015-04-24 12:54:39 301

原创 [ACdream]娜娜梦游仙境系列——吃不完的糖果

娜娜好不容易才在你的帮助下"跳"过了这个湖,果然车到山前必有路,大战之后必有回复,大难不死,必有后福!现在在娜娜面前的就是好多好多的糖果还有一些黑不溜秋的东西!不过娜娜眼中只有吃不完的糖果!娜娜高兴地快要蹦起来了!

2015-04-14 12:03:19 696

原创 [HDU1003]Max Sum

Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.

2015-04-13 21:16:25 247

原创 [Codeforces Round #295]DNA Alignment

Vasya became interested in bioinformatics. He's going to write an article about similar cyclic DNA sequences, so he invented a new method for determining the similarity of cyclic sequences.

2015-04-09 07:02:44 280

原创 [Codeforces Round #297]Ilya and Sticks

In the evening, after the contest Ilya was bored, and he really felt like maximizing. He remembered that he had a set of n sticks and an instrument. Each stick is characterized by its length li.

2015-04-09 05:35:17 260

原创 [ZeptoLab Code Rush 2015]Om Nom and Candies

A sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation that required him to think a bit in order to enjoy candies the most.

2015-04-08 20:03:25 392

原创 [ZeptoLab Code Rush 2015]Om Nom and Candies

A sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation that required him to think a bit in order to enjoy candies the most. Would you succeed with the same

2015-04-08 15:35:29 139

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除