- 博客(19)
- 资源 (2)
- 收藏
- 关注
原创 Slim Span
DescriptionGiven an undirected weighted graph G , you should find one of spanning trees specified as follows. The graph G is an ordered pair(V, E) , where V is a set of vertices{v1, v2
2014-11-26 19:49:15 1000
原创 Fill
DescriptionThere are three jugs with a volume of a, b and c liters. (a, b, and c are positive integers not greater than 200). The first and the second jug are initially empty, while the third
2014-11-26 19:22:22 909
原创 Swap Digits
DescriptionNow we have a number, you can swap any two adjacent digits of it, but you can not swap more than K times. Then, what is the largest probable number that we can get after you
2014-11-24 23:26:13 625
原创 Send a Table
When participating in programming contests, you sometimes face the following problem: You know how to calcutale the output for the given input values, but your algorithm is way too slow to ever pass t
2014-11-21 21:02:45 533
原创 A Spy in the Metro
DescriptionSecret agent Maria was sent to Algorithms City to carry out an especially dangerous mission. After several thrilling events we find her in the first station of Algorithms City Metro,
2014-11-21 20:30:24 1464
原创 Fabled Rooks
Problem F: Fabled Rooks We would like to placen rooks, 1 ≤ n ≤ 5000, on a n×n board subject to the following restrictionsThe i-th rook can only be placed within the rectangle given by its l
2014-11-21 20:19:01 977
原创 Not so Mobile
Not so MobileBefore being an ubiquous communications gadget, amobile was just a structure made of strings and wires suspending colourfull things. This kind of mobile is usually found h
2014-11-21 20:09:46 869
原创 Bandwidth
Given a graph (V,E) where V is a set of nodes and E is a set of arcs in VxV, and anordering on the elements in V, then the bandwidth of a node v is defined as the maximum distance in the ordering
2014-11-21 19:58:24 832
原创 机器分配
Problem Description总公司拥有高效设备M台,准备分给下属的N个分公司。各分公司若获得这些设备,可以为国家提供一定的盈利。问:如何分配这M台设备才能使国家得到的盈利最大?求出最大盈利值。其中M≤15,N≤10。分配原则:每个公司有权获得任意数目的设备,但总台数不超过设备数M。Input输入第一行为一个数T,表示测试示例的个数,对于每组测试示例,第一行有两个数
2014-11-20 19:18:39 750
原创 X-Plosives
Problem descriptionA secret service developed a new kind of explosive that attain its volatile property only when a speci cassociation of products occurs. Each product is a mix of two differen
2014-11-17 20:34:19 708
原创 4 Values whose Sum is 0
DescriptionThe SUM problem can be formulated as follows: given four listsA, B, C, D of integer values, compute how many quadruplet(a, b, c, d ) AxBxCxD are such that a + b + c + d = 0 . In
2014-11-11 20:44:31 650
原创 Trees on the level
BackgroundTrees are fundamental in many branches of computer science. Current state-of-the art parallel computers such as Thinking Machines' CM-5 are based onfat trees. Quad- and octal-trees are f
2014-11-11 19:51:48 811
原创 Tree
You are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least value from the root of the binary tree to any leaf. The value of a path is the sum o
2014-11-11 19:38:13 617
转载 浅谈New关键字
new关键字在我们的程序中可谓是无时不刻在用到,那么new关键字都可以用在哪些地方呢?考虑以下几个问题:1、new一个class对象和new一个struct或者new一个enum有什么不同? 答:new一个class时,new完成2个内容:一是调用newobj命令为实例在托管堆中分配内存,二是调用构造函数实现对象初始化。 new一个struct时,new运算符用于调用其构造函数,完
2014-11-11 15:30:16 583
原创 Stacks of Flapjacks
Stacks of FlapjacksBackgroundStacks and Queues are often considered the bread and butter of data structures and find use in architecture, parsing, operating systems, and discrete eve
2014-11-05 20:06:28 789
原创 Segment
DescriptionGiven n segments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments on it, all projected segments have at
2014-11-04 20:51:17 985
原创 Choose and divide
The binomial coefficient C(m,n) is defined as m!C(m,n) = -------- n!(m-n)!Given four natural numbers p, q, r, and s, compute the the result of dividing C(p,q) by C(r,s
2014-11-03 20:48:46 806
原创 汽水瓶
有这样一道智力题:“某商店规定:三个空汽水瓶可以换一瓶汽水。小张手上有十个空汽水瓶,她最多可以换多少瓶汽水喝?”答案是5瓶,方法如下:先用9个空瓶子换3瓶汽水,喝掉3瓶满的,喝完以后4个空瓶子,用3个再换一瓶,喝掉这瓶满的,这时候剩2个空瓶子。然后你让老板先借给你一瓶汽水,喝掉这瓶满的,喝完以后用3个空瓶子换一瓶满的还给老板。如果小张手上有n个空汽水瓶,最多可以换多少瓶汽水喝? 输入输
2014-11-03 20:05:24 576
原创 台球碰撞
在平面直角坐标系下,台球桌是一个左下角在(0,0),右上角在(L,W)的矩形。有一个球心在(x,y),半径为R的圆形母球放在台球桌上(整个球都在台球桌内)。受撞击后,球沿极角为a的射线(即:x正半轴逆时针旋转到此射线的角度为a)飞出,每次碰到球桌时均发生完全弹性碰撞(球的速率不变,反射角等于入射角)。 如果球的速率为v,s个时间单位之后球心在什么地方? 输入输入文件最
2014-11-03 19:56:49 1346
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人