原创 cf599C Day at the Beach(區間合併)

C. Day at the Beach time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputs

原创 cf599D Spongebob and Squares(推公式,枚舉)

Spongebob is already tired trying to reason his weird actions and calculations, so he simply asked you to find all

原创 Apple Catching(DP)

Description It is a little known fact that cows love apples. Farmer John has two apple trees (which are convenient

原创 K Smallest Sums(優先隊列+思維推廣)

You’re given k arrays, each array has k integers. There are k k ways to pick exactly one element in each array an

原创 Caesar's Legions(記憶化搜索)

Gaius Julius Caesar, a famous general, loved to line up his soldiers. Overall the army had n1 footmen and n2 horsem

原创 Dollar Dayz(DP)

Description Farmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. D

原创 A and B and Interesting Substrings(dp)

A and B are preparing themselves for programming contests. After several years of doing sports programming and solv

原创 Cow Exhibition(DP)

Description “Fat and docile, big and dumb, they look so stupid, they aren’t much fun…” - Cows with Guns by Dan

原创 607A Chain Reaction(DP)

There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level

原创 Coins(揹包DP)

Description People in Silverland use coins.They have coins of value A1,A2,A3…An Silverland dollar.One day Tony ope

原创 Space Elevator(DP)

Description The cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant

原创 Cable master(浮點數二分)

Description Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committ

原创 Writing Code(DP)

Programmers working on a large project have just received a task to write exactly m lines of code. There are n prog

原创 Layout(差束約分系統)

Description Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N

原创 Maximum Absurdity(dp)

Reforms continue entering Berland. For example, during yesterday sitting the Berland Parliament approved as much as