結果

問題 No.2178 Payable Magic Items
ユーザー 👑 p-adic
提出日時 2023-05-29 19:02:47
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 347 bytes
コンパイル時間 214 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,504 KB
最終ジャッジ日時 2024-12-28 10:11:47
合計ジャッジ時間 43,703 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16 TLE * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

I,R=input,range
N,K=map(int,I().split())
M=set()
P=pow(5,K-1)
for i in R(N):
	S=int(I(),5)
	for m in M:
		s,t,p,b=S,m,P,0
		for j in R(K):s,t,p,b=s%p,t%p,p//5,b+(t<s)
		if b<1:break
	else:
		L=[]
		for m in M:
			s,t,p,b=S,m,P,1
			for j in R(K):s,t,p,b=s%p,t%p,p//5,b*(t<=s)
			if b:L.append(m)
		for m in L:M.remove(m)
		M.add(S)
print(N-len(M))
0