- 博客(15)
- 收藏
- 关注
原创 Minimizing Difference(CodeForces - 1244E )
Minimizing DifferenceYou are given a sequence a1,a2,…,an consisting of n integers.You may perform the following operation on this sequence: choose any element and either increase or decrease it by o...
2019-10-19 15:05:50
466
原创 Crossing River (poj 1700)
Crossing RiverA group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement must be arranged in order to row the ...
2019-08-10 09:01:17
302
7
原创 Simple Problem with Integers POJ - 3468
Simple Problem with IntegersYou have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. T...
2019-08-04 18:38:00
234
1
原创 昂贵的聘礼 (POJ - 1062)
昂贵的聘礼年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。“探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来...
2019-07-30 15:39:34
503
原创 In Action(hdu-3339)
In ActionSince 1945, when the first nuclear bomb was exploded by the Manhattan Project team in the US, the number of nuclear weapons have soared across the globe.Nowadays,the crazy boy in FZU named ...
2019-07-30 15:27:37
182
原创 Watchcow (poj-2230)
WatchcowBessie’s been appointed the new watch-cow for the farm. Every night, it’s her job to walk across the farm and make sure that no evildoers are doing any evil. She begins at the barn, makes her...
2019-07-29 08:33:57
128
原创 Roadblocks (poj-3255)
RoadblocksBessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scenery along t...
2019-07-29 08:30:23
208
原创 Points in rectangle(hpu)
Points in rectangle单点时限: 2.0 sec内存限制: 512 MB在二维平面中有一个矩形,它的四个坐标点分别为(0,a),(a,0),(n,n−a),(n−a,n)。你现在有m个点,现在你想知道有多少个点是在这个矩形内的(边上的也算)。输入格式第一行输入n,a(1≤a<n≤103)。第二行一个正整数m(1≤m≤103),代表你拥有的点的个数,接下来m行,每行...
2019-07-29 08:22:33
125
原创 花花与三猫Catlive(hpu)
花花与三猫Catlive单点时限: 1.0 sec内存限制: 512 MB“大佬”中分和“呆B”李白正在玩一个游戏,游戏规则是这样的:游戏刚开始的时候,中分和李白相距L步,相对而望。老父亲和老母亲手中各有一个M个面的均匀骰子。(也就是说可以随机生成[1,m]内的任意一个数字,且概率均等)在每个回合开始的时候,老父亲和老母亲都会掷一下手中的骰子。当老父亲的骰子掷到1的时候,中分可以向...
2019-07-29 08:17:31
341
原创 再战斐波那契(hpu)
再战斐波那契单点时限: 1.0 sec内存限制: 512 MB小z 学会了斐波那契和 gcd 后,老师又给他出了个难题,求第N个和第M个斐波那契数的最大公约数,这可难倒了小z ,不过在小z 的再三请求下,老师又告诉他了个条件,gcd(N,M)∈[1,90]。可是,笨拙的小z 还是不会,于是请求你帮他解答这个问题。已知:输入格式输入包括 T 组,T∈[1,10].接下来 T 行,每...
2019-07-29 08:06:57
167
原创 Eight (hdu-1043)
EightThe 15-puzzle has been around for over 100 years; even if you don’t know it by that name, you’ve seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all ...
2019-07-21 20:54:50
300
原创 How many ways ( hdu-1978)
How many ways这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3.机器人不能在原地停留。4.当机器人选择了一条可行路径后,当他走到这条路径的终点时,他将只有终点所标记的能量。如上图,机器人一开始在...
2019-07-21 19:57:09
148
原创 Watering Grass (uva - 10382)
Watering Grassn sprinklers are installed in a horizontal strip of grass l meters long and w meters wide. Each sprinkleris installed at the horizontal center line of the strip. For each sprinkler we ...
2019-07-21 19:48:29
216
原创 Addition Chains (zoj-1937)
Addition ChainsAn addition chain for n is an integer sequence <a0, a1,a2,…,am> with the following four properties:a0 = 1am = na0 < a1 < a2 < … < am-1 < amFor each k (1 <= ...
2019-07-21 19:31:24
298
原创 Abbott's Revenge(UVA816)
Abbott’s Revenge(UVA816)The 1999 World FinalsContest included a problem based on a “dicemaze.” At the time the problem was written, the judges were unable todiscover the original source of the dice m...
2019-06-04 21:52:04
198
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人