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

6894번 - Spreadsheet 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB137770.000%

문제

A spreadsheet consists of a number of "cells" set in a rectangular grid. Each is addressed with one letter from $A$ to $J$ (giving the row) and one number from 1ドル$ to 9ドル$ (giving the column). Thus the upper-left cell of the spreadsheet is $A1,ドル and the lower-right cell is $J9$.

Every cell has a value, and this can be specified in one of two ways:

  1. as an integer from 0ドル$ to 1000ドル$
  2. as a sum of the values of up to 10ドル$ other cells

Cell values may be interdependent (that is, $A1$'s sum may depend on $B6$ which depends on $C9$), but a cell whose value depends on itself, directly or indirectly, is undefined (e.g., $A1$ depending on $G8$ depending on $A1$). Also, a cell whose value depends on an undefined cell is itself undefined. You are given the specification for all the cells in the spreadsheet. Compute and output the values of all of the cells.

입력

Input will consist of 10ドル$ lines, one per spreadsheet row. Each line contains 9 descriptions of a cell, which will be either an integer between 0ドル$ and 1ドル,000円,ドル or a sum of 1ドル$ to 10ドル$ distinct cell names separated by a + symbol (e.g. A1+B5+D3).

출력

Output 10ドル$ lines, with 9ドル$ numbers per line, giving the value of every cell in the spreadsheet; if the cell is undefined, print an asterisk (*) in place of its value. No cell's final value will exceed 1ドル,000円,000円,000円$.

제한

예제 입력 1

1 2 3 A1+A2+A3 A3+A4 A1+A4+A5 A8+A9 A9 A8
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0

예제 출력 1

1 2 3 6 9 16 * * *
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2004 > CCC 2004 Senior Division 3번

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

출처

대학교 대회

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

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