We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6822e4c commit ea71981Copy full SHA for ea71981
Hongjoo/백준/한국이그리울땐서버에접속하지.py
@@ -0,0 +1,34 @@
1
+"""
2
+https://www.acmicpc.net/problem/9996
3
4
+N = int(input())
5
+# Q. a*b는 asbasd도 정답인가?
6
+# 1. 변수 입력 받기
7
+pattern = list(input().split('*'))
8
+cmstr = [[] for k in range(N)]
9
+
10
+for i in range(N):
11
+ # cmstr[i] = [x for x in input()]
12
+ cmstr[i] = input()
13
+#2.
14
15
16
+ # 패턴 앞, 뒤 매칭하기
17
+ if cmstr[i][:len(pattern[0])] != pattern[0] or cmstr[i][-len(pattern[-1]):] != pattern[-1]:
18
+ print("NE")
19
+ continue
20
+ # 안 맞음
21
22
+ flag = [False * len(pattern[1:-1])]
23
+ point = len(pattern[0])
24
+ for p in pattern[1:-1] : # 패턴 내부
25
+ cnt = cmstr[i][point:].find(p)
26
+ if cnt < 0 : #없으면
27
28
+ break
29
+ # 있으면 - 그 이전에 있음
30
+ point = cnt
31
32
+ print("DA")
33
34
0 commit comments