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

27124번 - Cow Scans 다국어채점 준비 중

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

문제

Farmer John has just invested in a shiny new Locowter-2000 for tracking his grazing cows. The Locowter-2000's best feature is that it does not need to get input from anywhere except the perimeter of the verdant pastures in which the cows are grazing.

Farmer John has conveniently partitioned his field into a grid of 10 rows and 15 columns of cow-sized grazing-cells, each of which can host either 0 or 1 dining bovines.

The Locowter-2000 sports a battery of scanners located on fence posts around the pasture. Each of the 73 scanners counts the number of cows in its direct line of sight. Farmer John has arranged the scanners to observe the number of cows in each row, in each column, and in each diagonal (both directions!).

The numbers are fed back to the L2000's cowputer, which cowculates the locowtions of Farmer John's feeding friends and displays a graphical map of those locowtions using ASCII graphics. Regrettably, the L2000's cowputer has been decowmissioned for maintenance and Farmer John needs you to cowculate his cow locowtions.

The scanners' output is given as a set of integers representing the numbers of cows observed on the various rows, columns, and diagonals. The first 10 numbers represent the rows; note the order of letters in the diagram below:

a->.##########....
b->.##########....
c->....######.....
d->......####.....
e->.......####..##
f->.......########
g->#####..########
h->###############
i->..#########..##
j->....######.....

The second 24 numbers are diagonals; see the letters below for the ordering:

.##########....
/.##########....
a/....######.....
b/......####.....
c/.......####..##
d/.......########
e/#####..########
f/###############
g/..#########..##
h/....######.....
i///////////////
jklmnopqrstuvwx

The third 15 numbers are the columns; see the letters below for the ordering:

.##########....
.##########....
....######.....
......####.....
.......####..##
.......########
#####..########
###############
..#########..##
....######.....
|||||||||||||||
abcdefghijklmno

The final 24 numbers are the other diagonals; see the letters below for the ordering:

.##########....
.##########....\
....######.....\x
......####.....\w
.......####..##\v
.......########\u
#####..########\t
###############\s
..#########..##\r
....######.....\q
\\\\\\\\\\\\\\\p
 abcdefghijklmno

The sample input datafile for this particular example looks just like this:

10 10 6 4 6 8 13 15 11 6
0 1 2 2 2 2 4 5 5 6 7 6 5 6 6 5 5 6 6 3 2 2 1 0
2 4 5 5 7 6 7 10 10 10 7 3 3 5 5
0 0 1 3 4 4 4 4 3 4 5 7 8 8 9 9 6 4 4 2 0 0 0 0

Your program should prompt for a file name, then use the data in that file to reconstruct a diagram of the cow's grazing locations. Note that there do exist datasets in the universe that can not be precisely decoded given this kind of input data. Farmer John's Courteous Cows never arrange themselves in any of these positions. You will be able to determine the value of every grazing-cell without resorting to any guesswork.

입력

Four input lines with 10, 24, 15, and 24 numbers, respectively, denote the number of cows seen (as per the rules above).

출력

Ten lines of 15 characters that represent the only possible set of cows described by the input file.

제한

예제 입력 1

10 10 6 4 6 8 13 15 11 6
0 1 2 2 2 2 4 5 5 6 7 6 5 6 6 5 5 6 6 3 2 2 1 0
2 4 5 5 7 6 7 10 10 10 7 3 3 5 5
0 0 1 3 4 4 4 4 3 4 5 7 8 8 9 9 6 4 4 2 0 0 0 0

예제 출력 1

.##########....
.##########....
....######.....
......####.....
.......####..##
.......########
#####..########
###############
..#########..##
....######.....

힌트

출처

Olympiad > USA Computing Olympiad > 1998-1999 Season > USACO Winter 1999 Contest > Division A 2번

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

출처

대학교 대회

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

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