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

18913번 - Graph Coloring 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB147757153.383%

문제

You are given a tournament, represented as a complete directed graph (for all pairs $i,j$ of two different vertices, there is exactly one edge among $i \to j$ and $j \to i$), with $n \leq 3000$ vertices. You need to color its edges into 14ドル$ colors.

There should be no path $i \to j \to k$ in this graph such that the colors of edges $i \to j$ and $j \to k$ are the same.

It is guaranteed that this is always possible.

입력

The first line of input contains one integer $n$ (3ドル \leq n \leq 3000$): the number of vertices in the given tournament.

Next $n-1$ lines contain the description of the graph: the $i$-th line contains a binary string with $i$ characters.

If the $j$-th character in this string is equal to '1', then the graph has an edge from $(i + 1) \to j$. Otherwise, it has an edge from $j \to (i+1)$.

출력

The output should contain $n-1$ lines, where the $i$-th line contains a string with $i$ characters.

The $j$-th character in this string should be a lowercase Latin letter between 'a' and 'n'. If the graph has an edge from $(i + 1) \to j,ドル then this character represents the color of the edge from $(i + 1) \to j$. Otherwise it represents the color of the edge from $j \to (i + 1)$.

There should be no path $i \to j \to k$ in this graph such that the colors of edges $i \to j$ and $j \to k$ are the same.

제한

예제 입력 1

3
1
11

예제 출력 1

a
ab

예제 입력 2

5
1
10
100
0100

예제 출력 2

a
bc
def
ghij

힌트

출처

Contest > Open Cup > 2019/2020 Season > Stage 16: Grand Prix of Moscow G번

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

출처

대학교 대회

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

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