You are on page 1of 4

[2011-03-01 - 09:20:13]

Matrix operations:
- Reversal from the midline
- Reversing toward the median column
- Reversal from the center of the matrix
- A matrix transpose
Example:
f.in
3 4
1 2 3 4
5 6 7 8
9 10 11 12
f.out
Invert from the midline:
9 10 11 12
5 6 7 8
1 2 3 4
Invert compared to the median column:
4 3 2 1
8 7 6 5
December 11 10 9
Invert from the center of the matrix:
December 11 10 9
8 7 6 5

Class IX
[2010-12-13 - 22:53:38]
The decrease in large numbers
Natural numbers with many digits can save by using vectors. Compute and it displ
ays the difference of two integers stored in two vectors and b n m elements resp
ectively.
Figures numbers will be introduced from the keyboard without any space between t
hem.
Example: see figure above
Resolution
[2010-12-13 - 22:53:46]
Multiplication of large numbers
Natural numbers with many digits can save by using vectors. Compute and it displ
ays the product of two integers stored in two vectors and b n m elements respect
ively.
Figures numbers will be introduced from the keyboard without any space between t
hem.
Example: see figure above
Resolution
[2011-02-13 - 11:10:43]
Generare.in file reads a natural number n at most 20. It is written in the file
generare.out the nth term of the sequence 1, 11, 21, 1211 111 221, 312 211, 3111
2221 ...
Resolution
[2011-02-13 - 11:46:39]
A black and white image is represented MXM encoded in a matrix with elements 0 o
r 1. Whether the image can do the following:
- Reversal, that values ??1 and 0 turns the 1 in 0;

- Rotate 90 degrees clockwise;


- Zoom, ie doubling matrix (2mX2m size).
A sequence of transformations is defined as a sequence of letters I, R and Z, co
rresponding to the three operations above.
Imag.in reads file descriptor n and then encoded in a matrix image MXM.
Trans.in file is a sequence of letters I, R and Z corresponding transformations
required.
Imag.out to write the file size of the array and matrix obtained after this tran
sformation.
Disclaimer: m not exceed 100 regardless of changes.
Example:
imag.in
2
1 1
0 1
trans.in
RRRRIZ
imag.out
4
0 0 0 0
0 0 0 0
1 1 0 0
1 1 0 0
Resolution
[2011-02-15 - 14:38:59]
An orchard is divided into nXm areas. In each area grows one tree. From each tre
e falls down a quantity of fruit.
In the upper left is a hedgehog who wants to get into the right corner. Hedgehog
can only move in two directions: down or right.
Determine the maximum amount of fruit you can gather the Hedgehog by moving in t
he desired starting position.
Reading is the file that contains the first line arici.in orchard size, ie n and
m, and then the amount of fruit in each of the nXm areas.
Displaying the maximum amount of fruit will be arici.out file.
Example:
arici.in
March 3
0 4 1
0 1 1
1 0 1
arici.out
7
Resolution
[2011-02-20 - 19:24:17]
A frame moves clockwise spiral in the opposite direction in a rectangular area,
into and out of the ground. Moving frame is alternately ground and surface. At t
he meeting a hole was left in the ground if the surface and comes to the surface
if it was in the ground. Rama.in configuration file is read rectangular area in
the frame starts from coordinates (1,1). Potholes are armed with the value 0, a
nd the rest being the 1. display the number of holes that will surface frame and
their coordinates.
Example:

rama.in
4
1 1 1 0
1 0 1 0
1 1 0 1
0 0 0 1
rama.out
3
2 4
4 2
February 2
Resolution
[2011-03-01 - 09:20:13]
Matrix operations:
- Reversal from the midline
- Reversing toward the median column
- Reversal from the center of the matrix
- A matrix transpose
Example:
f.in
3 4
1 2 3 4
5 6 7 8
9 10 11 12
f.out
Invert from the midline:
9 10 11 12
5 6 7 8
1 2 3 4
Invert compared to the median column:
4 3 2 1
8 7 6 5
December 11 10 9
Invert from the center of the matrix:
December 11 10 9
8 7 6 5
4 3 2 1
Transposed:
1 5 9
2 6 October
3 July 11
4 8 December
Resolution
[05/13/2013 - 10:15:07]
A pool table can be represented by a matrix of n rows and m columns (m odd)
ered from 1.
The billiard table has a total of six openings arranged in the four corners
in the middle of one line (1, m / 2 + 1) and the line miljlocul n (n, m / 2
.
Position 1.1 launches a ball at 45 degrees (southeast). Establish where the
s will enter the ball after how many steps.
Steps are taken as the positions of the matrix through which bile. When the
touches the edge of the table, the ball bounces symmetrical.
Example:
n = 4 m = 5

numb
and
+ 1)
hole
ball

the ball will move below


1 0 7 0 0
0 2 0 6 0
0 0 3 0 5
0 0 0 4 0
and enter the hole 1.3 after 7 steps.
date.in
5:15
date.out
31 0 0 0 1 0 0 0 21 0 11 0 0 0 0
30 0 32 0 0 0 0 22 0 20 0 12 0 0 0
0 3 0 33 0 29 23 9 0 19 0 13 0 0 0
28 0 4 0 34 0 0 8 0 0 0 18 0 14 0
0 27 0 25 0 0 35 0 0 0 0 0 17 0 15
26 0 6 0 0 0 0 36 0 0 0 0 0 16 0
June 8, 36 (hole steps)
4 3 2 1
Transposed:
1 5 9
2 6 October
3 July 11
4 8 December

You might also like