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

30534번 - Split Decisions 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
6 초 (추가 시간 없음) 1024 MB38121257.143%

문제

A Split Decisions puzzle is a type of crossword in which each across and down answer is a pair of words instead of a single word (as in standard crossword puzzles). Each pair of words are identical except in exactly two adjacent positions for which letters have been provided in the puzzle -- these sets of letters serve as the clue for the pair of words. In the left half of Figure K.1, the letter pairs “IN” and “CR” are given, and the words “SINEW” and “SCREW” can be used to solve that clue. The right half of the figure shows a typical Split Decisions puzzle.

Figure K.1: A small Split Decisions puzzle, with an example solved clue.

While we could ask you to solve a given Split Decisions puzzle, we've decided on a slightly different task for you. Given a list of words, we want you to find pairs of words which could be used in a Split Decisions puzzle. Specifically, each pair must differ in exactly two consecutive letters AND be the only possible pair of words that work for those sets of letters (i.e., no other pair of words in the list of words solve that clue).

For example, if your list of words contained the words CELL, GULL, GUSH, HALL, and HASH, you could make two clues: [CE/GU]_ _ (for the answer pair CELL/GULL) and [CE/HA]_ _ (for the answer pair CELL/HALL). Note that the clue [GU/HA]_ _ has two possible solutions (GULL/HALL and GUSH/HASH) so it should not be considered.

입력

The first line contains a positive integer $n$ (1ドル \leq n \leq 1,500円$) indicating the number of words in the word list. This is followed by $n$ lines each containing one word. Each word consists of uppercase letters and no word has less than 3ドル$ or more than 20ドル$ letters.

출력

The number of unique pairs of words in the input for which a valid Split Decisions clue exists.

제한

예제 입력 1

5
CELL
GULL
GUSH
HALL
HASH

예제 출력 1

2

힌트

출처

ICPC > Regionals > North America > East Central North America Regional > 2023-2024 East Central NA Regional Contest K번

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

출처

대학교 대회

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

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