LightOJ 1138Trailing Zeroes (III)(二分)

Description You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*...

2016-08-24 09:27:24

阅读数 292

评论数 0

LightOJ 1043Triangle Partitioning(数学)

Description See the picture below. You are given AB, AC and BC. DE is parallel to BC. You are also given the area ratio between ADE and BDEC....

2016-08-24 09:01:50

阅读数 148

评论数 0

CodeForces 658ABear and Reverse Radewoosh(数学)

Description Limak and Radewoosh are going to compete against each other in the upcoming algorithmic contest. They are equally skilled but they won't...

2016-08-23 10:03:42

阅读数 175

评论数 0

CodeForces 554BOhana Cleans Up(思维)

Description Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or d...

2016-08-23 09:58:40

阅读数 221

评论数 0

CodeForces 660ACo-prime Array(GCD+思维)

Description You are given an array of n elements, you must make it a co-prime array in as few moves as possible. In each move you can insert any ...

2016-08-23 09:00:16

阅读数 205

评论数 0


Description 晴天也来寻宝啦,有一个m层的宝塔,只能从第一层开始一层一层的往上走,每层都有一个门,你需要用钥匙来打开门才能继续走,现在晴天有n把钥匙,编号为0-n-1,然后他要开始寻宝了。没有特殊技能怎么好意思出来寻宝呢,他现在有两个天赋技能,他知道第i层的门可以用编号为a和b的钥匙打...

2016-08-19 17:04:45

阅读数 240

评论数 0

zzulioj1915 H

Description 在三维空间里,晴天得到了一些坐标,然后他想知道这些坐标有没有重合的哇,然后若两个坐标是重合的也就是x=x,y=y,z=z。然后他把这个任务交给你啦。 Input 输入第一行包含一个整数t表示有多少组数据。 每组数据一个整数n,表示有多少个点。 接下来n行,每行...

2016-08-19 15:52:39

阅读数 247

评论数 0

UVA 10200Prime Time(素数)

Euler is a well-known matematician, and, among many other things, he discovered that the formula n 2 + n + 41 produces a prime for 0 ≤ n Even though...

2016-08-15 16:27:28

阅读数 186

评论数 0

HDU1155Bungee Jumping(物理+数学)

Description Once again, James Bond is fleeing from some evil people who want to see him dead. Fortunately, he has left a bungee rope on a nearby hig...

2016-08-15 11:41:48

阅读数 368

评论数 0

LightOJ1104Birthday Paradox(思维+数学)

Description Sometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party ...

2016-08-15 11:28:27

阅读数 209

评论数 0

CodeForces 510BFox And Two Dots(dfs)

Description Fox Ciel is playing a mobile puzzle game called "Two Dots". The basic levels are played on a board of size n × m cells, like th...

2016-08-15 11:08:52

阅读数 190

评论数 0

zzulioj1908: 小火山的围棋梦想(dfs)

Description 小火山最近喜欢上了围棋。 对于围棋,其实小火山是一窍不通的。现在棋盘上,有很多小火山的棋子。 如果棋盘上有这样的一个位置, 那么这个位置也会变成小火山 的棋子;这样的位置是指小火山的棋子将该位置围起来。 现在,小火山想知道实际棋盘是什么样子的。 你快来帮帮他吧! ...

2016-08-13 11:53:40

阅读数 311

评论数 0

zzulioj1899 985的最大和难题(思维)

Description 985有2 * n - 1个整数,他每次可以将其中n个数变号,操作次数不限,问他可以得到的最大和。 Input 第一行输入一个整数t,代表有t组测试数据。 每组数据占两行,第一行输入一个整数n,下面一行输入2*n-1个整数a[]。 注:1 Outp...

2016-08-10 11:53:19

阅读数 208

评论数 0


Description Given n different objects, you want to take k of them. How many ways to can do it? For example, say there are 4 items; you want to ta...

2016-08-10 09:49:21

阅读数 261

评论数 1

zzulioj1895: 985的0-1串难题(思维)

Description 985有一个长度为n的0-1串,已知他最多可以修改k次(每次修改一个字符即0->1 或者 1->0),他想知道连续的全1子串最长是多少。 Input 第一行输入一个整数t,代表有t组测试数据。 每组数据第一行输入两个整数n,k分别代笔上面的信息。 注:1 ...

2016-08-09 20:16:43

阅读数 321

评论数 0

zzulioj1893: 985的数学难题(二进制计算)

Description 985有n个正整数,他想快速知道下面函数的返回值 int a[N+1]; long long Solve() { int i, j; long long ans = 0; for(i = 1; i for(int j = i + 1; j ans += a[i] + a...

2016-08-09 16:09:14

阅读数 195

评论数 0


Description Consider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different ari...

2016-08-09 09:32:50

阅读数 181

评论数 0


Description 都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能...

2016-08-09 08:39:28

阅读数 149

评论数 0


Description Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film...

2016-08-08 17:42:13

阅读数 302

评论数 0

HDU1003Max Sum(dp)

Description 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...

2016-08-08 16:17:35

阅读数 136

评论数 0

取消 删除