- 博客(44)
- 资源 (15)
- 收藏
- 关注
原创 CSU1646: HearthStone(DP)
DescriptionHenry十分钟爱炉石传说(Heart Stone)这款有趣的桌面卡牌游戏。我们简化的游戏规则如下:游戏由两人对战,出牌并尽量对对方造成最大的伤害,一共进行 r轮。前10轮,第i轮你有i个法力水晶;之后每轮都有10个法力水晶。前一轮未使用的法力水晶不能累积到下一轮。有两种卡牌,随从卡 “达拉然法师” 和 法术卡 “刺骨”。
2015-05-31 18:35:19 1276
原创 CSU1648: Swipe
Description德鲁伊在炉石传说中是一个很稳定的职业,主流的卡组套路有咆哮德,城墙德以及让人很无奈的疲劳德。然而,大部分的卡组总都包括“横扫”这张德鲁伊的职业法术卡。 我们假定战场上的敌人数目不定,敌人的血量已知,我们想知道最少使用多少张“横扫”能消灭战场上所有敌人。Input第一行一个整数T( T接下来有T组数据,每组数据第一行n (
2015-05-31 18:31:43 940
原创 CSU1649: Transfer
Description给你一个用火柴棍摆成的个位数加减法算式,要你求出至少要移动多少根火柴棍才能使算式成立。等于和加号的那一横和减号不能移动,加号移掉一竖变成减号,减号移过来一竖变成加号。具体看图片的几个例子。Input多个样例(大约2000个),每个样例占一行,有a+b=c 或a-b=c其中0 Output对于每个样例输出一个整数占一行
2015-05-31 18:29:40 880
原创 CSU1654: 收集金币
Description有一条路上有一排的金币,如果把这条路看做一个数轴,那么在1~n的位置上各有一个金币,共n个,每个金币有一个不同的编号1~n(不一定按顺序).在0位置上有一个人,他有很多神奇的小车,他可以在0位置释放神奇的小车,每个小车一旦被释放就会沿着数轴正方向每个单位时间走一个单位距离.如果一个小车所在的位置有金币且这个金币的编号是剩余金币中编号最小的,而且如果收集了这个金币能
2015-05-31 18:25:34 1351 1
原创 URAL1297:Palindrome(后缀数组)
DescriptionThe “U.S. Robots” HQ has just received a rather alarming anonymous letter. It states that the agent from the competing «Robots Unlimited» has infiltrated into “U.S. Robotics”. «U.S. R
2015-05-31 00:40:10 2236 3
原创 SPOJ694&&SPOJ705:Distinct Substrings(后缀数组)
DescriptionGiven a string, we need to find the total number of its distinct substrings.InputT- number of test cases. TEach test case consists of one string, whose length is OutputFor e
2015-05-29 15:27:17 2348
原创 POJ3261:Milk Patterns(后缀数组)
DescriptionFarmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation, he discovered that although he can't predict the quality of milk fro
2015-05-29 15:10:55 4308
原创 poj1743:Musical Theme(后缀数组)
DescriptionA musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It is unfortunate but true that this re
2015-05-29 13:31:05 4610 3
原创 POJ2774:Long Long Message(后缀数组)
DescriptionThe little cat is majoring in physics in the capital of Byterland. A piece of sad news comes to him these days: his mother is getting ill. Being worried about spending so much on railwa
2015-05-28 20:23:36 4611
原创 CSU1631: Facility Locations
DescriptionThe HDWBP Inc. has n clients and needs to service these clients by opening k facilities. Each opened facility can serve any number of clients and each client must be served by an open f
2015-05-25 15:39:43 1014
原创 CSU1633: Landline Telephone Network
DescriptionThe mayor of RMRCity wants to create a secure landline telephone network for emergency use in case of serious disasters when the city is cut off from the outside world. Some pairs of bu
2015-05-25 14:41:07 1106
原创 CSU1635: Restaurant Ratings
DescriptionA famous travel web site has designed a newrestaurant rating system. Each restaurant is ratedby one of n (1 n 15) critics, each givingthe restaurant a nonnegative numeric rati
2015-05-25 14:09:27 1517
原创 CSU1630: Plane Ticket Pricing
DescriptionPlane ticket prices fluctuate wildly from one week to the next, and their unpredictability is a major source of frustration for travellers. Some travellers regret buying tickets too ear
2015-05-25 14:02:45 1071
原创 CSU1622: Generalized Roman Numerals(区间DP)
DescriptionInputOutputSample InputIVXXIXIX0Sample OutputCase 1: 4 6Case 2: 8 10 28 30 32HINTSource题意:给出一个罗马数字,要你输出这罗马数字所有可能组成的数罗马数字组成规则:1
2015-05-18 19:13:24 1406
原创 CSU1619: Con + tin / (ued + Frac / tions)
DescriptionInputOutputSample Input4 35 1 1 25 2 20 0Sample OutputCase 1:110 530 4 61 27HINTSource题意:根据给定的数字算出r1,r2,然后对于r1,r2的四则运算我们要用一系列的
2015-05-18 16:39:05 1752 1
原创 CSU1626: Time Warp
DescriptionInputOutputSample Input420 after 8126 til 4180 til 10 after 12Sample OutputCase 1: 8:47:16Case 2: 3:39:16Case 3: 12:32:44Case 4: 1:05:27HINT
2015-05-17 19:50:19 1032
原创 CSU1620: A Cure for the Common Code(KMP+区间DP)
DescriptionInputOutputSample Inputabcbcbcbcaabbbcdcdcdabbbcdcdcd0Sample OutputCase 1: 7Case 2: 11HINTSource题意:把字符串简化,问简化得到的最短长度是多少思路:要简化首先要
2015-05-17 19:48:54 1240
原创 Codeforces544E:Remembering Strings(状态压缩)
You have multiset of n strings of the same length, consisting of lowercase English letters. We will say that those strings are easy to remember if for each string there is some position i and some l
2015-05-15 22:30:42 1670
原创 Codeforces544D:Destroying Roads(最短路)
In some country there are exactly n cities and m bidirectional roads connecting the cities. Cities are numbered with integers from 1 to n. If cities a and b are connected by a road, then in an h
2015-05-15 13:51:14 2192
原创 Codeforces544C:Writing Code(完全背包)
Programmers working on a large project have just received a task to write exactly m lines of code. There are n programmers working on a project, the i-th of them makes exactly ai bugs in every lin
2015-05-15 13:48:22 1935
原创 Codeforces544B:Sea and Islands
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly k is
2015-05-15 13:41:11 1212
原创 Codeforces544A:Set of Strings
You are given a string q. A sequence of k strings s1, s2, ..., sk is called beautiful, if the concatenation of these strings is string q (formally,s1 + s2 + ... + sk = q) and the first characters
2015-05-15 13:37:38 1492
原创 POJ1037:A decorative fence(DP)
DescriptionRichard just finished building his new house. Now the only thing the house misses is a cute little wooden fence. He had no idea how to make a wooden fence, so he decided to order one. S
2015-05-13 22:20:55 1839
原创 POJ1692:Crossed Matchings
DescriptionThere are two rows of positive integer numbers. We can draw one line segment between any two equal numbers, with values r, if one of them is located in the first row and the other one i
2015-05-12 20:02:50 1534
原创 POJ1019:Number Sequence
DescriptionA single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2...Sk. Each group Sk consists of a sequence of pos
2015-05-11 20:45:22 1641
原创 BNU49101:rating计算
whalyzh最近参加了一个叫做BC(BNU CODER)比赛,比赛分为N场。参加的每个账号都有一个rating,初始时rating值为1500,每场比赛后系统会对参加的账号进行评价,如果评价为good,则该账号rating增加100分,但是不会超过3299;如果评价为bad,则该账号rating下降100分,但是不会低于0分。为了避免越做rating越低的情况,whalyzh注册了两个账号,每场
2015-05-11 16:21:13 1872
原创 BNU49098:神奇的身高
有一群小伙伴站成一行,每个人的身高都是非负整数,但是他们站在一起并不和谐。需要将他们的身高变成严格单调递增的正整数序列才是和谐的。现在你有一种神奇的魔法,可以任意改变一个人的身高。现在问题来了,你最少需要改变多少人的身高才能使整个队伍和谐。(改变后的身高必须为整数)Input有多组测试数据,保证大数据不超过15组。每组测试数据:第1行:一个数n表示人数(1≤
2015-05-11 16:15:41 1152
原创 BNU49103:贪心(二分)
小明喜欢养小鸡,小鸡喜欢吃小米。小明很贪心,希望养s只不同种类的小鸡,小鸡也很贪心,每天除了吃固定的ai粒小米外,还想多吃bi*s粒小米。小明每天有M(0(0种。问小明最多可以养多少只小鸡? Input多组数据,请读到文件尾第一行,整数N,M,以空格分隔,之后两行,第一行为N个整数ai,第二行为N个整数bi。ai、bi都在int范围内
2015-05-11 16:13:12 1069
原创 CSU1616: Heaps(区间DP)
DescriptionZuosige always has bad luck. Recently, he is in hospital because of pneumonia. While he is taking his injection, he feels extremely bored. However, clever Zuosige comes up with a new ga
2015-05-10 20:03:19 842
原创 CSU1615: Garden
DescriptionZuosige always has bad luck. Recently, he is in hospital because of pneumonia. While he is taking his injection, he feels extremely bored. However, clever Zuosige comes up with a new ga
2015-05-10 20:02:41 531
原创 CSU1611: Concatenation(状态压缩)
DescriptionZuosige always has bad luck. Recently, he is in hospital because of pneumonia. While he is taking his injection, he feels extremely bored. However, clever Zuosige comes up with a new ga
2015-05-10 19:58:04 929
原创 CSU1612: Destroy Tunnels
DescriptionZuosige always has bad luck. Recently, he is in hospital because of pneumonia. While he is taking his injection, he feels extremely bored. However, clever Zuosige comes up with a new ga
2015-05-10 19:52:28 856
原创 CSU1613: Elephants(分组背包)
DescriptionZuosige always has bad luck. Recently, he is in hospital because of pneumonia. While he is taking his injection, he feels extremely bored. However, clever Zuosige comes up with a new ga
2015-05-10 19:51:41 1036
原创 CSU1614:First Blood
DescriptionZuosige always has bad luck. Recently, he is in hospital because of pneumonia. While he is taking his injection, he feels extremely bored. However, clever Zuosige comes up with a new ga
2015-05-10 19:47:09 1061
原创 CSU1610: Binary Subtraction
DescriptionZuosige always has bad luck. Recently, he is in hospital because of pneumonia. While he is taking his injection, he feels extremely bored. However, clever Zuosige comes up with a new ga
2015-05-10 19:47:07 886
原创 POJ1934:Trip(LCS)
DescriptionAlice and Bob want to go on holiday. Each of them has planned a route, which is a list of cities to be visited in a given order. A route may contain a city more than once. As they wan
2015-05-08 17:59:19 1667
原创 ZOJ3299:Fall the Brick(区间更新)
Now the God is very angry, so he wants to punish the lazy, greedy humans. He chooses to throw some lines of bricks (just down from the very high Heaven). These days the God lives in a 2D world, so h
2015-05-08 16:21:36 1367
原创 Codeforces35E:Parade(区间更新)
E. Paradetime limit per test4 secondsmemory limit per test64 megabytesinputinput.txtoutputoutput.txtNo Great Victory anniversary in Berland has ever passed with
2015-05-06 23:33:28 1499
原创 Codeforces276E:Little Girl and Problem on Trees
A little girl loves problems on trees very much. Here's one of them.A tree is an undirected connected graph, not containing cycles. The degree of node x in the tree is the number of nodes y of t
2015-05-05 01:09:11 1762
原创 CSU1601: War(并查集)
DescriptionAME decided to destroy CH’s country. In CH’ country, There are N villages, which are numbered from 1 to N. We say two village A and B are connected, if and only if there is a road betwe
2015-05-03 19:55:02 1063
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人