[POJ 1625] Censored! (AC 로봇 + DP+ 정수)
Find out how many different sentences can be used now by freelanders without risk to be put to jail for using it.
Input The first line of the input file contains three integer numbers: N -- the number of letters in Freish alphabet, M -- the length of all Freish sentences and P -- the number of forbidden words (1 <= N <= 50, 1 <= M <= 50, 0 <= P <= 10). The second line contains exactly N different characters -- the letters of the Freish alphabet (all with ASCII code greater than 32).
The following P lines contain forbidden words, each not longer than min(M, 10) characters, all containing only letters of Freish alphabet.
Output
Output the only integer number -- the number of different sentences freelanders can safely use.
Sample Input 2 3 1 ab
bb
Sample Output
5
일반적인 문자열 금지 문제지만 AC가 죽어도 안 되고 인터넷상의 일부 프로그램도 빅데이터를 찍어도 문제없다.모르겠어요.. 일단 놔두세요.
AC 이(가) 정수로 출력되어 ←←
본 문제의 문제점:
(1) 데이터를 입력하는 문자에 빈칸이 있다고 하니 scanf에%s를 추가하지 말고 gets로 읽으십시오.
(2) 데이터를 입력하는 문자가 127(음수)보다 클 수 있다고 하니 수조로 비추지 말고 맵으로 비추는 것을 권장합니다.
(3) 이 문제는 공간이 비교적 엄격하기 때문에 10진법의 정수는 통하지 않는다.
데이터는 POJ의discuss에서 찾을 수 있습니다.
다음은 어리석기 짝이 없는 코드다.
#include
#include
#include
#include
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
HDU4758 Walk Through Squares AC 자동기 & &dp이 문제는 그때 할 때 수론제라고 생각했는데 01열 두 개가 포함돼 있었다. 경기 후에 문자열이라고 듣고 그럴 가능성이 높았다.어제 팀원들이 이 문제를 물었는데 AC자동기를 배운 후에 많이 간단해졌다고 느꼈다.그때는...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.