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

7496번 - Dictionary of Obscene Words 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB111150.000%

문제

Given a dictionary of obscene words S1, S2, ..., Snand text T, find if text contains one of obscene words as subsequence. If it does, find smallest prefix of T that contains such subsequence.

입력

First line of input contains one integer n - number of words in dictionary. Following n lines contain words from dictionary, one per line. Each word consists of ASCII characters with codes from 32 to 127, inclusive. Next line contains text T, consisting of the same set of characters. Total length of all words in dictionary doesn't exceed 100 KiB (100 x 210bytes). Total size of input file doesn't exceed 1 MiB (220bytes).

출력

Output NO if there is no obscene subsequence in the text. Otherwise output YES <X>, where X is the length of smallest prefix of T that contains some obscene subsequence.

제한

예제 입력 1

2
hello
world
abracadabra

예제 출력 1

NO

예제 입력 2

2
hello
world
zzzheluuuulottt

예제 출력 2

YES 12

힌트

출처

ICPC > Regionals > Europe > Southeastern European Regional Contest > All-Ukrainian Collegiate Programming Contest > AUCPC 2010 F번

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

출처

대학교 대회

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

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