
北邮OJ
文章平均质量分 75
LoveTaeyeon
这个作者很懒,什么都没留下…
展开
-
2:A-B Problem
DescriptionCalculate A-BInputTwo decimal integers a and b(-10^100 < a,b < 10^100) in one line, separated by one space.OutputOutput a-b in one line.Sample Input1 2Sample Out原创 2013-03-29 08:58:31 · 643 阅读 · 0 评论 -
16:棋盘分割
Description将一个8*8的棋盘进行如下分割:将原棋盘割下一块矩形棋盘并使剩下部分也是矩形,再将剩下的部分继续如此分割,这样割了(n-1)次后,连同最后剩下的矩形棋盘共有n块矩形棋盘。(每次切割都只能沿着棋盘格子的边进行)原棋盘上每一格有一个分值,一块矩形棋盘的总分为其所含各格分值之和。现在需要把棋盘按上述规则分割成n块矩形棋盘,并使各矩形棋盘总分的原创 2013-04-08 19:38:34 · 609 阅读 · 0 评论 -
18:Intersection
DescriptionYouare to write a program that has to decide whether a given linesegment intersects a given rectangle. An example: line:start point: (4,9) end point: (11,2) rectangl原创 2013-04-08 19:48:49 · 529 阅读 · 0 评论 -
19:卡片(即POJ 1091)
Description在一张卡片上面,有N+1个正整数,最后一个数是M,而前N个数都不超过M,设为a1,a2, a3, …, aN, 问是否存在整数x1,x2, x3, …, xN, x(N+1),满足x1*a1 + x2*a2 +...+ xN*aN +x(N+1)*M = 1。当确定N和M后,显然一共有M^N张不同的卡片。现在的问题是,在这所有的卡片中,原创 2013-04-08 20:18:22 · 899 阅读 · 0 评论 -
23:Easy problem
DescriptionThereis N pairs of balls in a small box. That means the number for eachpair is the same. However, for some reason, a ball is lost. Now, youwill get the number of the rest. Can原创 2013-04-09 15:07:45 · 575 阅读 · 0 评论 -
24:Minimum Sum
DescriptionYou are given N positive integers, denoted as x1, x2 ... xN. Then give you some intervals [l, r]. For each interval, you need to find a number x to make |x-xl| + |x-x2| + … + |x原创 2013-04-12 08:25:10 · 693 阅读 · 0 评论 -
31:B ·Nim-B* Sum
B ·Nim-B* SumNIM is an ambigram . The game of NIM is played with any number of piles of objects with any number of objects in each pile. At each turn, a player takes one or more (up to all) object原创 2013-04-14 09:22:58 · 771 阅读 · 0 评论 -
32:C·Non-Decreasing Digits
C ·Non-Decreasing DigitsA number is said to be made up of non-decreasing digits if all the digits to the left of any digit is less than or equal to that digit. For example, the four-digit number 1原创 2013-04-14 19:28:48 · 809 阅读 · 0 评论 -
34:E ·Power Network(最大流基础算法篇)
A power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amount s(u)³0 of power, may produce an amount 0£p(u)£原创 2013-04-27 23:59:54 · 685 阅读 · 0 评论 -
34:E ·Power Network(最大流算法-----压入重标法篇)
算法分析部分转自该博客:点击打开链接与Ford-Fulkerson方法不同,压入和重标记算法不是检查整个残留网络来找出增广路径,而是每次仅对一个顶点进行操作,并且仅检查残留网络中该顶点的相邻顶点。压入和重标记算法引入了一个新的概念叫做余流,余流的定义为e(u)=f(V,u)。我们知道,在流网络满足三个限制条件的情况下有e(u)=0,但是在该算法的执行过程中,并不能保证流守恒,但原创 2013-04-29 00:16:15 · 870 阅读 · 0 评论 -
12:Heavy Cargo
DescriptionBig Johnsson Trucks Inc. is a company specialized in manufacturing big trucks. Their latest model, the Godzilla V12, is so big that the amount of cargo you can transport with it is neve原创 2013-04-06 20:07:42 · 882 阅读 · 0 评论 -
15:Panic Room
DescriptionYou are the lead programmer for the Securitron 9042, the latest and greatest in home security software from Jellern Inc. (Motto: We secure your stuff so YOU can't even get to it). T原创 2013-04-06 21:28:00 · 644 阅读 · 0 评论 -
6:Flip Game
DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other one is black and each piece is lying e原创 2013-03-29 10:04:41 · 1250 阅读 · 0 评论 -
9:Maximum sum
DescriptionGiven a set of n integers: A={a1, a2,..., an}, we define a function d(A) as below:d(A)=sum{a[s1]~a[t1]}+sum{a[s2]~a[t2]}The rule is 1Your task is to calculate d(A).InputThe in原创 2013-03-29 11:22:14 · 693 阅读 · 0 评论 -
1:A+B Problem
DescriptionCalculate a+bInputTwo integer a,b (0OutputOutput a+bSample Input1 1Sample Output2package OJ;import java.util.*;public class P1 { /** * @param原创 2013-03-29 08:51:59 · 610 阅读 · 0 评论 -
7:Fence Repair
DescriptionFarmer 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 ≤ 1,000)) planks of wood, each having some integer le原创 2013-03-29 10:30:21 · 647 阅读 · 0 评论 -
8:Rightmost Digit
Problem DescriptionGiven a positive integer N, you should output the most right digit of N^N. InputThe input contains several test cases. The first line of the input is a single integer T which原创 2013-03-29 10:48:50 · 623 阅读 · 0 评论 -
10:Rpg Game
Description There are n cells in a sequence. You can use three kinds of colors, red , pink , green to paint these cells , one cell with only one kind of color . Promising that any two adjacent cel原创 2013-03-29 11:31:53 · 563 阅读 · 0 评论 -
5:Permutation
Description We all know that , when there are n positive integers (namely 1…n) , we can use these n integers to construct n! kinds of permutations . Sort these permutations in lexicographic order原创 2013-03-29 10:00:58 · 619 阅读 · 0 评论 -
13:K-based Numbers
DescriptionLet’sconsiderK-basednumbers, containing exactly Ndigits. We define a number to be valid if its K-basednotation doesn’t contain two successive zeros. For example: 10102原创 2013-04-06 20:32:48 · 891 阅读 · 0 评论 -
14:Labeling Balls
DescriptionWindy hasNballs of distinct weights from 1 unit toNunits. Now he tries to label them with 1 toNin such a way that:No two balls sharethe same label.The labeli原创 2013-04-06 21:08:25 · 741 阅读 · 0 评论 -
35:Video Surveillance
A friend of yours has taken the job of security officer at the Star-Buy Company, a famous department store. One of his tasks is to install a video surveillance system to guarantee the security of the原创 2013-04-29 21:00:57 · 1114 阅读 · 0 评论