Submission #1136263

#TimeUsernameProblemLanguageResultExecution timeMemory
1136263hwcho98Play Onwards (FXCUP2_onward)Pypy 3
0 / 1
158 ms48804 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)

Compiling 'onward.py'...

=======
  adding: __main__.pyc (deflated 35%)

=======
#Verdict Execution timeMemoryGrader output
Fetching results...