没有合适的资源?快使用搜索试试~ 我知道了~
首页欧洲地区ACM试题(2000-2007)
欧洲地区ACM试题(2000-2007)
需积分: 10 116 下载量 189 浏览量
更新于2023-03-03
评论
收藏 7.66MB PDF 举报
世界各地(包括世界总决赛及各个地区竞赛如北美, 亚洲, 欧洲, 拉美, 大洋州, 非洲和中东等)最新(2000-2007)的ACM竞赛英文真题.<br>这是欧洲地区部分.文件格式为pdf.
资源详情
资源评论
资源推荐
2153 - Simple Arithmetics
Europe - Central - 2000/2001
One part of the new WAP portal is also a calculator computing expressions with very long numbers. To make
the output look better, the result is formated the same way as is it usually used with manual calculations.
Your task is to write the core part of this calculator. Given two numbers and the requested operation, you are
to compute the result and print it in the form specified below. With addition and subtraction, the numbers are
written below each other. Multiplication is a little bit more complex: first of all, we make a partial result for
every digit of one of the numbers, and then sum the results together.
Input
There is a single positive integer T on the first line of input. It stands for the number of expressions to follow.
Each expression consists of a single line containing a positive integer number, an operator (one of +, - and *)
and the second positive integer number. Every number has at most 500 digits. There are no spaces on the line.
If the operation is subtraction, the second number is always lower than the first one. No number will begin
with zero.
Output
For each expression, print two lines with two given numbers, the second number below the first one, last
digits (representing unities) must be aligned in the same column. Put the operator right in front of the first
digit of the second number. After the second number, there must be a horizontal line made of dashes (-).
For each addition or subtraction, put the result right below the horizontal line, with last digit aligned to the last
digit of both operands.
For each multiplication, multiply the first number by each digit of the second number. Put the partial results
one below the other, starting with the product of the last digit of the second number. Each partial result should
be aligned with the corresponding digit. That means the last digit of the partial product must be in the same
column as the digit of the second number. No product may begin with any additional zeros. If a particular
digit is zero, the product has exactly one digit -- zero. If the second number has more than one digit, print
another horizontal line under the partial results, and then print the sum of them.
There must be minimal number of spaces on the beginning of lines, with respect to other constraints. The
horizontal line is always as long as necessary to reach the left and right end of both numbers (and operators)
right below and above it. That means it begins in the same column where the leftmost digit or operator of that
two lines (one below and one above) is. It ends in the column where is the rightmost digit of that two
numbers. The line can be neither longer nor shorter than specified.
Print one blank line after each test case, including the last one.
Sample Input
4
12345+67890
324-111
325*4405
1234*4
2153 - Simple Arithmetics 1/2
Sample Output
12345
+67890
------
80235
324
-111
----
213
325
*4405
-----
1625
0
1300
1300
-------
1431625
1234
*4
----
4936
Central 2000-2001
2153 - Simple Arithmetics 2/2
2154 - The Bulk
Europe - Central - 2000/2001
ACM uses a new special technology of building its transceiver stations. This technology is called Modular
Cuboid Architecture (MCA) and is covered by a patent of Lego company. All parts of the transceiver are
shipped in unit blocks that have the form of cubes of exactly the same size. The cubes can be then connected
to each other. The MCA is modular architecture, that means we can select preferred transceiver configuration
and buy only those components we need.
The cubes must be always connected "face-to-face", i.e. the whole side of one cube is connected to the whole
side of another cube. One cube can be thus connected to at most six other units. The resulting equipment,
consisting of unit cubes is called The Bulk in the communication technology slang.
Sometimes, an old and unneeded bulk is condemned, put into a storage place, and replaced with a new one. It
was recently found that ACM has many of such old bulks that just occupy space and are no longer needed.
The director has decided that all such bulks must be disassembled to single pieces to save some space.
Unfortunately, there is no documentation for the old bulks and nobody knows the exact number of pieces that
form them. You are to write a computer program that takes the bulk description and computes the number of
unit cubes.
Each bulk is described by its faces (sides). A special X-ray based machine was constructed that is able to
localise all faces of the bulk in the space, even the inner faces, because the bulk can be partially hollow (it can
contain empty spaces inside). But any bulk must be connected (i.e. it cannot drop into two pieces) and
composed of whole unit cubes.
Input
There is a single positive integer T on the first line of input. It stands for the number of bulks to follow. Each
bulk description begins with a line containing single positive integer F, 6 <= F <= 250, stating the number of
faces. Then there are F lines, each containing one face description. All faces of the bulk are always listed, in
any order. Any face may be divided into several distinct parts and described like if it was more faces. Faces do
not overlap. Every face has one inner side and one outer side. No side can be "partially inner and partially
outer".
Each face is described on a single line. The line begins with an integer number P stating the number of points
that determine the face, 4 <= P <= 200. Then there are 3 x P numbers, coordinates of the points. Each point is
described by three coordinates X,Y,Z (0 <= X,Y,Z <= 1000) separated by spaces. The points are separated
from each other and from the number P by two space characters. These additional spaces were added to make
the input more human readable. The face can be constructed by connecting the points in the specified order,
plus connecting the last point with the first one.
The face is always composed of "unit squares", that means every edge runs either in X, Y or Z-axis direction.
If we take any two neighbouring points X
1
,Y
1
,Z
1
and X
2
,Y
2
,Z
2
, then the points will always differ in exactly
one of the three coordinates. I.e. it is either X
1
<> X
2
, or Y
1
<> Y
2
, or Z
1
<> Z
2
, other two coordinates are the
same. Every face lies in an orthogonal plane, i.e. exactly one coordinate is always the same for all points of
the face. The face outline will never touch nor cross itself.
2154 - The Bulk 1/2
Output
Your program must print a single line for every test case. The line must contain the sentence The bulk is
composed of V units., where V is the volume of the bulk.
Sample Input
2
12
4 10 10 10 10 10 20 10 20 20 10 20 10
4 20 10 10 20 10 20 20 20 20 20 20 10
4 10 10 10 10 10 20 20 10 20 20 10 10
4 10 20 10 10 20 20 20 20 20 20 20 10
4 10 10 10 10 20 10 20 20 10 20 10 10
5 10 10 20 10 20 20 20 20 20 20 15 20 20 10 20
4 14 14 14 14 14 16 14 16 16 14 16 14
4 16 14 14 16 14 16 16 16 16 16 16 14
4 14 14 14 14 14 16 16 14 16 16 14 14
4 14 16 14 14 16 16 16 16 16 16 16 14
4 14 14 14 14 16 14 16 16 14 16 14 14
4 14 14 16 14 16 16 16 16 16 16 14 16
12
4 20 20 30 20 30 30 30 30 30 30 20 30
4 10 10 10 10 40 10 40 40 10 40 10 10
6 10 10 20 20 10 20 20 30 20 30 30 20 30 40 20 10 40 20
6 20 10 20 20 20 20 30 20 20 30 40 20 40 40 20 40 10 20
4 10 10 10 40 10 10 40 10 20 10 10 20
4 10 40 10 40 40 10 40 40 20 10 40 20
4 20 20 20 30 20 20 30 20 30 20 20 30
4 20 30 20 30 30 20 30 30 30 20 30 30
4 10 10 10 10 40 10 10 40 20 10 10 20
4 40 10 10 40 40 10 40 40 20 40 10 20
4 20 20 20 20 30 20 20 30 30 20 20 30
4 30 20 20 30 30 20 30 30 30 30 20 30
Sample Output
The bulk is composed of 992 units.
The bulk is composed of 10000 units.
Central 2000-2001
2154 - The Bulk 2/2
2155 - Complete the sequence!
Europe - Central - 2000/2001
You probably know those quizzes in Sunday magazines: given the sequence 1, 2, 3, 4, 5, what is the next
number? Sometimes it is very easy to answer, sometimes it could be pretty hard. Because these "sequence
problems" are very popular, ACM wants to implement them into the "Free Time" section of their new WAP
portal.
ACM programmers have noticed that some of the quizzes can be solved by describing the sequence by
polynomials. For example, the sequence 1, 2, 3, 4, 5 can be easily understood as a trivial polynomial. The next
number is 6. But even more complex sequences, like 1, 2, 4, 7, 11, can be described by a polynomial. In this
case, 1/2.n
2
-1/2.n+1 can be used. Note that even if the members of the sequence are integers, polynomial
coefficients may be any real numbers.
Polynomial is an expression in the following form:
P(n) = a
D
.n
D
+a
D-1
.n
D-1
+...+a
1
.n+a
0
. If a
D
<> 0, the number D is called a degree of the polynomial. Note that constant function P(n) = C can be
considered as polynomial of degree 0, and the zero function P(n) = 0 is usually defined to have degree -1.
Input
There is a single positive integer T on the first line of input. It stands for the number of test cases to follow.
Each test case consists of two lines. First line of each test case contains two integer numbers S and C
separated by a single space, 1 <= S < 100, 1 <= C < 100, (S+C) <= 100. The first number, S, stands for the
length of the given sequence, the second number, C is the amount of numbers you are to find to complete the
sequence.
The second line of each test case contains S integer numbers X
1
, X
2
, ... X
S
separated by a space. These
numbers form the given sequence. The sequence can always be described by a polynomial P(n) such that for
every i, X
i
= P(i). Among these polynomials, we can find the polynomial P
min
with the lowest possible
degree. This polynomial should be used for completing the sequence.
Output
For every test case, your program must print a single line containing C integer numbers, separated by a space.
These numbers are the values completing the sequence according to the polynomial of the lowest possible
degree. In other words, you are to print values P
min
(S+1), P
min
(S+2), .... P
min
(S+C).
It is guaranteed that the results P
min
(S+i) will be non-negative and will fit into the standard integer type.
Sample Input
4
6 3
1 2 3 4 5 6
8 2
1 2 4 7 11 16 22 29
2155 - Complete the sequence! 1/2
剩余717页未读,继续阅读
yuanlinios
- 粉丝: 0
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- RTL8188FU-Linux-v5.7.4.2-36687.20200602.tar(20765).gz
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0