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

27591번 - Three Dice 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 1024 MB52292764.286%

문제

Given a list of three-letter words, generate one possible set of three, six-sided dice such that each word can be formed by the top faces of some arrangement of the three dice. You must distribute 18 distinct letters across the 18 total faces of the dice. There may be multiple possible sets of dice that satisfy the requirement; any correct set will be accepted.

입력

The first line of input contains an integer $n$ $(1\le n\le 1,000円),ドル which is the number of words.

Each of the next $n$ lines contains one three-letter word made up only of lowercase letters (a--z). There may be duplicate words in the list, and the words might contain identical letters.

출력

Output a single line. If there exists a set of dice that can form all of the words, output any such set. Output the set of dice as one line with three space-separated strings, each consisting of six lowercase letters. If no such set of dice can be formed, output a single line with the number 0.

제한

예제 입력 1

3
lad
fin
sly

예제 출력 1

zounds plight fakery

예제 입력 2

1
dad

예제 출력 2

0

예제 입력 3

11
aft
cog
far
irk
kit
yes
tau
rag
own
uke
via

예제 출력 3

vortex whacky fusing

힌트

출처

ICPC > Regionals > North America > Mid-Atlantic Regional > 2022 Mid-Atlantic USA Regional Contest > Division 1 J번

ICPC > Regionals > North America > South Central USA Regional > 2022 South Central USA Regional Contest > Division 1 J번

ICPC > Regionals > North America > Southeast USA Regional > 2022 Southeast USA Regional Programming Contest > Division 1 J번

ICPC > Regionals > North America > Mid-Atlantic Regional > 2022 Mid-Atlantic USA Regional Contest > Division 2 J번

ICPC > Regionals > North America > South Central USA Regional > 2022 South Central USA Regional Contest > Division 2 J번

ICPC > Regionals > North America > Southeast USA Regional > 2022 Southeast USA Regional Programming Contest > Division 2 J번

ICPC > Regionals > North America > Pacific Northwest Regional > 2022 ICPC Pacific Northwest Region > Division 1 A번

ICPC > Regionals > North America > Pacific Northwest Regional > 2022 ICPC Pacific Northwest Region > Division 2 A번

  • 문제를 만든 사람: Howard Whitston
(追記) (追記ここまで)

출처

대학교 대회

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

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