Logo
(追記) (追記ここまで)

26507번 - Rhonda 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB69525076.923%

문제

Rhonda is printing processor chips, which can be made from fabricated components inscribed onto thin layers. As she prints the chips, Rhonda stacks two or more layers together to create a final chip made up of multiple layers.

She has several unique layers that can be combined into various numbers of layers, which allows her to create a variety of chips. Each layered component is represented by a 10x10 grid of integers, with each cell containing an integer ranging from 0 to 9. The final chip is also 10x10 grid, with each cell being the sum of all the cells in that position for the layers that were used to create the chip.

For example, if Rhonda has fabricated 3 layers:

0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
1111111111
1111111111
1111111111
1111111111
1111111111
1111111111
1111111111
1111111111
1111111111
1111111111
0011001100
1100110011
0011001100
1100110011
0011001100
1100110011
0011001100
1100110011
0011001100
1100110011

and decides to create a final chip that combines only the first and second layers, the resulting chip is represented by the 10x10 grid below:

01 02 03 04 05 06 07 08 09 10
01 02 03 04 05 06 07 08 09 10
01 02 03 04 05 06 07 08 09 10
01 02 03 04 05 06 07 08 09 10
01 02 03 04 05 06 07 08 09 10
01 02 03 04 05 06 07 08 09 10
01 02 03 04 05 06 07 08 09 10
01 02 03 04 05 06 07 08 09 10
01 02 03 04 05 06 07 08 09 10
01 02 03 04 05 06 07 08 09 10

Each layer is indexed by the order given (starting at zero). The data set for this chip would be:

0 1

since this chip is made by combining the first and second layer in the order given.

The cell values of each individual layer will be in the range 0-9, and the cell values of the final chip combined chips will in the range 0-99. All original fabricated layers will be unique.

입력

The first line of the input will an integer, i, representing the number of unique layers Rhonda has fabricated. This is followed by i sets of 10x10 grid of integers, each followed by a new line, representing the i fabricated layers. The next line will be a single positive integer, n, indication the number of data sets that follow. Each data set is a list of integers, all on one line, separated by spaces, which represent the layers added to create a chip.

출력

A 10x10 integer grid with each of the 10x10 cells represented by 2 digits and a space, the whole grid representing the final summed chip.

제한

예제 입력 1

3
0101010101
0101010101
0101010101
0101010101
0101010101
0101010101
0101010101
0101010101
0101010101
0101010101
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
0123456789
7386459728
3748244739
8420475820
1938475283
3847520734
5826752039
4230489329
4594890835
2188305727
4320834420
3
0 1
0 1 2
0 0 0 0 0 0 0 0 0 0

예제 출력 1

00 02 02 04 04 06 06 08 08 10
00 02 02 04 04 06 06 08 08 10
00 02 02 04 04 06 06 08 08 10
00 02 02 04 04 06 06 08 08 10
00 02 02 04 04 06 06 08 08 10
00 02 02 04 04 06 06 08 08 10
00 02 02 04 04 06 06 08 08 10
00 02 02 04 04 06 06 08 08 10
00 02 02 04 04 06 06 08 08 10
00 02 02 04 04 06 06 08 08 10
07 05 10 10 08 11 15 15 10 18
03 09 06 12 06 10 10 15 11 19
08 06 04 04 08 13 11 16 10 10
01 11 05 12 08 13 11 10 16 13
03 10 06 11 09 08 06 15 11 14
05 10 04 10 11 11 08 08 11 19
04 04 05 04 08 14 15 11 10 19
04 07 11 08 12 15 06 16 11 15
02 03 10 12 07 06 11 15 10 17
04 05 04 04 12 09 10 12 10 10
00 10 00 10 00 10 00 10 00 10
00 10 00 10 00 10 00 10 00 10
00 10 00 10 00 10 00 10 00 10
00 10 00 10 00 10 00 10 00 10
00 10 00 10 00 10 00 10 00 10
00 10 00 10 00 10 00 10 00 10
00 10 00 10 00 10 00 10 00 10
00 10 00 10 00 10 00 10 00 10
00 10 00 10 00 10 00 10 00 10
00 10 00 10 00 10 00 10 00 10

힌트

출처

School > PLU High School Programming Contest > PLU 2016 > Novice 8번

School > PLU High School Programming Contest > PLU 2016 > Advanced 11번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /