POJ Face The Right Way(尺取法+贪心)

Description Farmer John has arranged his N (1 ≤ N ≤ 5,000) cows in a row and many of them are facing forward, like good cows. Some of them are facin...

2016-04-30 00:41:43

阅读数:715

评论数:0

POJ 2785 4 Values whose Sum is 0(排序+二分搜索)

Description The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈...

2016-04-29 10:54:16

阅读数:330

评论数:0

POJ 3320 Jessica's Reading Problem(尺取法)

Description Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time ...

2016-04-28 00:08:01

阅读数:241

评论数:0

POJ 3061 Subsequence (二分查找)

Description A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 ...

2016-04-27 16:26:34

阅读数:269

评论数:0

POJ 3723Conscription

Description Windy has a country, and he wants to build an army to protect his country. He has picked up N girls and M boys and wants to collect them ...

2016-04-26 12:59:45

阅读数:296

评论数:0

POJ 3255Roadblocks

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

2016-04-25 20:09:46

阅读数:200

评论数:0

POJ 2456Aggressive cows

Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positi...

2016-04-25 11:24:08

阅读数:198

评论数:0

UVa 10006 - Carmichael Numbers

连接网址:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=947 这一题的用到快速幂的求法:  代码如下 A...

2016-04-21 20:50:20

阅读数:255

评论数:0

POJ1182 食物链

Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法...

2016-04-20 18:25:03

阅读数:267

评论数:0

POJ 2431 Expedition

Description A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately ma...

2016-04-18 21:55:15

阅读数:212

评论数:0

NYOJ 176 整数划分(二)

整数划分(二) 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 把一个正整数m分成n个正整数的和,有多少种分法? 例:把5分成3个正正数的和,有两种分法: 1 1 3 1 2 2 输入 第一行是一个整数T表示共有T组测试数据(T 每组测...

2016-04-18 15:55:06

阅读数:381

评论数:0

NYOJ 整数划分

整数划分 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 将正整数n表示成一系列正整数之和:n=n1+n2+…+nk, 其中n1≥n2≥…≥nk≥1,k≥1。 正整数n的这种表示称为正整数n的划分。求正整数n的不 同划分个数。 例如正整数6有如下11种不同的划分:...

2016-04-18 13:56:11

阅读数:256

评论数:0

POJ 3253Fence Repair

Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 2...

2016-04-17 16:55:47

阅读数:192

评论数:0

POJ 3069Saruman's Army

Description Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distribu...

2016-04-17 16:35:21

阅读数:249

评论数:0

POJ 3617Best Cow Line

Description FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer a...

2016-04-17 15:15:30

阅读数:236

评论数:0

POJ Lake Counting

Description Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= ...

2016-04-17 14:12:27

阅读数:190

评论数:0

HDU u Calculate e

Problem Description A simple mathematical formula for e is where n is allowed to go to infinity. This can actually yield very accurate approx...

2016-04-17 12:32:05

阅读数:251

评论数:0

FOJ Problem 2221 RunningMan

Problem Description ZB loves watching RunningMan! There's a game in RunningMan called 100 vs 100. There are two teams, each of many people. There...

2016-04-14 16:35:35

阅读数:673

评论数:0

FOJ Problem 2218 Simple String Problem

Problem Description Recently, you have found your interest in string theory. Here is an interesting question about strings. You are given a string S...

2016-04-13 22:44:57

阅读数:639

评论数:0

FOJ Problem 2216 The Longest Straight

Problem Description ZB is playing a card game where the goal is to make straights. Each card in the deck has a number between 1 and M(including 1 an...

2016-04-12 16:25:21

阅读数:402

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭