# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
28660 | 핑응핑응 홍신정 (#68) | Play Onwards (FXCUP2_onward) | Cpython 3 | 22 ms | 3 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
import sys
N, K = [ int(i) for i in input().split() ]
words = []
for i in range(N):
words.append(input())
sub_word = []
for index, word in enumerate(words):
sub_word.append([])
sub_word[index].append(0)
for i in range(len(word) - K + 1):
sub_word[index].append(word[i:i+K])
#sub_word.append(words[word])
#print(sub_word)
for index, words in enumerate(sub_word):
#print(sub_word)
#print()
if words[0] == 0:
words[0] = 1
for i in sub_word[index+1:]:
for j in i[1:]:
if j in words[1:]:
if i[0] == words[0]:
print("No")
sys.exit(1)
elif words[0] == 1:
i[0] = 2
else:
i[0] = 1
#print(sub_word)
print("Yes")
for i in sub_word:
print(i[0])
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |