| RACSODFACFGOperations: Reg, CFPDAReductions: K, WP, CFG, NP, SATANTLR: lex, synExams | log in, register, become guest |
· · · · · · 1 2 3 ·---·---· ·---·---·---1 2 3
| | | | |
· 4 · · · · · · · · 4 · · ·---·---·---· ·
| | | | | |
5 · · 1 · · · · · 5 · · 1 · ·---·---·---·
| | | |
· · · 2 · · · · · ·---· · 2---· · ·---·---·
| | | | |
· 3 · · · · · 6 · · 3 · ·---·---· · 6 ·
| | | | | | |
· · · · 7 · · · · · · · · 7---· · · ·
| | | | | | | |
· · · · · · 8 · 8 · · · ·---· · 8 · 8
| | | | | |
· · · 5 · · 7 6 9 · · ·---5 · ·---7 6 9
| | | |
4 · · · · 9 · · · 4 ·---·---·---· 9---·---·---·
board: array of array of int k: intThe input is the matrix board, and the number of pipe end pairs. A cell board[i][j] contains a when it is empty, and a number when it contains one of the pipe ends for the pair .
segments: array of array [2] of struct {
r: int
c: int
}
The output is a list of cell pairs, each cell being identified by a struct
with the fields r (row) and c (column). Each pair of cells denotes
that there is a pipe segment connecting those two cells, which must be adjacent
cells.
|
|