- 博客(24)
- 资源 (4)
- 收藏
- 关注
原创 回溯法Square
SquareDescriptionGiven a set ofsticks of various lengths, is it possible to join them end-to-end to form asquare?InputThe first line ofinput contains N, the number of test cases. Each test cas
2015-11-26 19:46:22
481
原创 回溯法Matrix
MatrixDescriptionGiven an n*nmatrix A, whose entries Ai,j are integer numbers ( 0 <= i < n, 0 <= j< n ). An operation SHIFT at row i ( 0 <= i < n ) will move theintegers in the row one position ri
2015-11-26 19:39:10
412
原创 回溯法Perfect Cubes
Perfect CubesDescriptionFor hundreds ofyears Fermat's Last Theorem, which stated simply that for n > 2 there existno integers a, b, c > 1 such that a^n = b^n + c^n, has remained elusivelyunproven.
2015-10-01 09:34:13
671
原创 回溯法之Additive equations
Additive equationsTime Limit: 10 Seconds Memory Limit: 32768 KB We all understandthat an integer set is a collection of distinct integers. Now the question is:given an integer
2015-09-29 19:43:45
656
原创 回溯 dp FatMouse and Cheese
FatMouse and Cheese FatMouse has stored some cheese in a city.The city can be considered as a square grid of dimension n: each grid locationis labelled (p,q) where 0 <= p < n and 0 <= q < n. At ea
2015-09-28 23:15:25
493
原创 回溯算法之Anagrams by Stack
Anagrams by Stack How can anagrams result from sequences ofstack operations? There are two sequences of stack operators which can convertTROT to TORT:[i i i i o o o oi o i i o o i o]wher
2015-08-18 21:05:19
636
原创 回溯法之Fire Net
Fire NetSuppose that we have a square city withstraight streets. A map of a city is a square board with n rows and n columns,each representing a street or a piece of wall.A blockhouse is a small c
2015-08-16 16:09:21
449
原创 贪心算法之Elevator Stopping Plan
Elevator Stopping PlanDescriptionZSoft Corp. is asoftware company in GaoKe Hall. And the workers in the hall are veryhard-working. But the elevator in that hall always drives them crazy. Why?Becau
2015-08-16 10:30:58
2398
原创 贪心算法之Evil Straw Warts Live
Evil Straw Warts LiveDescriptionA palindrome is astring of symbols that is equal to itself when reversed. Given an input string,not necessarily a palindrome, compute the number of swaps necessar
2015-08-15 19:40:59
756
原创 贪心算法之ian Ji -- The Horse Racing
Tian Ji -- The Horse RacingDescriptionHere is a famousstory in Chinese history. That was about2300 years ago. General Tian Ji was a high official in the country Qi. He likesto play horse racing
2015-08-15 16:44:27
1082
原创 贪心算法New Year BonusGrant
New Year BonusGrant All programmers of Mocrosoft softwarecompany are organized in a strict subordination hierarchy. Every programmer hasexactly one chief, except Bill Hates who is also the head of
2015-08-14 23:09:40
551
原创 贪心算法之Stripies
Stripies Our chemical biologists have invented anew very useful form of life called stripies (in fact, they were first calledin Russian - polosatiki, but the scientists had to invent an English na
2015-08-10 09:51:17
689
原创 贪心算法之Radar Installation
Radar InstallationDescriptionAssume thecoasting is an infinite straight line. Land is in one side of coasting, sea inthe other. Each small island is a point locating in the sea side. And any radar
2015-08-09 23:20:17
401
原创 贪心算法之Packets
PacketsDescriptionA factory producesproducts packed in square packets of the same height h and of the sizes 1*1,2*2, 3*3, 4*4, 5*5, 6*6. These products are always delivered to customers inthe squa
2015-08-09 14:40:57
1719
1
原创 贪心算法之Entropy
EntropyDescriptionAn entropy encoderis a data encoding method that achieves lossless data compression by encoding amessage with "wasted" or "extra" information removed. Inother words, entropy enco
2015-08-08 21:48:52
635
原创 动态规划之Cash Machine
Cash MachineDescriptionA Bank plans toinstall a machine for cash withdrawal. The machine is able to deliverappropriate @ bills for a requested cash amount. The machine uses exactly Ndistinct bill
2015-08-03 21:17:10
627
原创 动态规划之UNIMODAL PALINDROMIC DECOMPOSITIONS
UNIMODAL PALINDROMIC DECOMPOSITIONSDescriptionA sequence ofpositive integers is Palindromic if it reads the same forward and backward. Forexample: 23 11 15 1 37 37 1 15 11 23 1 1 2 3 4 7 7 10
2015-08-03 19:59:08
649
原创 动态规划之Jury Compromise
Jury Compromise In Frobnia, a far-awaycountry, the verdicts in court trials are determined by a jury consisting ofmembers of the general public. Every time a trial is set to begin, a jury hasto be
2015-07-31 13:16:54
595
原创 Optimal ArrayMultiplication Sequence
Optimal ArrayMultiplication SequenceGiven two arrays A and B, we can determinethe array C = A B using the standard definition of matrix multiplication:The number of columns in the A array mustbe
2015-07-30 09:36:10
483
原创 典型动态规划之Always On the Run
Always On the RunDescriptionScreeching tires. Searching lights. Wailing sirens.Police cars everywhere. Trisha Quickfinger did it again! Stealing the `MonaLisa' had been more difficult than planned
2015-07-29 11:05:00
495
原创 一个箱子的推箱子算法
题目意思:很简单,推箱子。给出步骤最少的一种方案即可解题思路:本题宜采用优先队列,使得步骤越少其优先级越高。关键在于处理son数组的问题。
2015-07-28 10:04:25
6245
原创 求给定M个数组合构成N的最小倍数
MultipleDescriptiona program that,given a natural number N between 0 and 4999 (inclusively), and M distinctdecimal digits X1,X2..XM (at least one), finds the smallest strictly positivemultiple of
2015-07-26 15:44:13
1422
原创 求无序不重复正整数数列最小字串的长度
Longest Ordered SubsequenceDescriptionA numeric sequence of ai is ordered if a1 a2 aN. Let the subsequence of the given numeric sequence (a1, a2, ..., aN) be any sequence (ai1, ai2, ..., aiK
2014-11-05 20:31:09
524
动态规划Multiple
2015-07-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人