# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1136263 | hwcho98 | Play Onwards (FXCUP2_onward) | Pypy 3 | 158 ms | 48804 KiB |
import sys
input = sys.stdin.readline
n,k = map(int,input().split())
lst = [set() for _ in range(3)]
ans = []
for _ in range(n):
cur = input().rstrip()
part = set([cur[i-k:i] for i in range(k,len(cur)+1)])
for t in range(1,3):
if len(part) == len(part-lst[t]):
ans.append(t)
lst[t].update(part)
break
else:
exit(print('No'))
if ans.count(1) == n:
ans[-1] = 2
print('Yes')
print(*ans,sep='\n')
Compilation message (stdout)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |