OlveraeUNSW
返回题目列表
COMP2521

24T2 Q11 — 一日可达

路网有两个 N×N 邻接矩阵:先标准路后高速。一天内可走一条标准边,或一/两条连续高速边。stdin:N START、标准矩阵、高速矩阵。升序、空格分隔打印从 START 一天内可达的所有顶点(不含 START)。


Single-file C (gcc -O0 -Wall). Self-contained reframing of the exam's ADT-completion question. From COMP2521 24T2 Sample.

样例

stdin
4 0
0 1 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 1 0
0 0 0 0
0 0 0 1
0 0 0 0
期望输出
1 2 3
c-gcc
14