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

3717번 - Search by template 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 128 MB314337.500%

문제

The pattern P and the text T are given. They contain the letters of the Latin alphabet (lowercase and uppercase). The pattern may also contain the characters '?', '[', ']', '{' and '}' You must find all the positions where P appears in T.

Each position in the pattern P may contain:

  • a letter from the Latin alphabet ('a' – 'z', 'A' – 'Z')
  • the character '?' that can replace any letter (on its place can be any letter)
  • brackets '['...']', between them there is the set of letters that may be in the current position
  • brackets '{'...'}', between them there is the set of letters that are not allowed to be in the current position
  • the letters can be repeated in brackets like [asssa] or {kLLf}.

For example, if the pattern P is A?[bcCc]{De}, then the first letter of a match must be A, the second can be any Latin letter, the third - letter b, c or C, and the fourth can be any Latin letter except D or e.

입력

The first line contains the number of test cases n. Each test consists of two lines. The first line contains the pattern P with no more than 100 characters and 60 positions. The second line contains the text with no more than 106 letters.

출력

For each test case print on a separate line all text positions where the pattern matches, in ascending order (the first letter from the text T is assumed to have the position ‘1’). If the pattern P does not appear in text T, print the message "no match". There must be a single space between each printed position, and no extra space at the beginning/end of line.

제한

예제 입력 1

3
A?[bcCc]{De}
yAqCpsApbeAocqq
???[QWERTY]
aSdFrQererRTY
{eRT}?
eRTeRTq

예제 출력 1

2 11
3 8 9 10
no match

힌트

출처

ICPC > Regionals > Europe > Southeastern European Regional Contest > SEERC 2011 C번

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

출처

대학교 대회

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

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