結果

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

ソースコード

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)
	b=0
	for m in M:
		s,t,p=S,m,P
		for j in R(K):
			b+=t<s
			s,t,p=s%p,t%p,p//5
		if 1-b:break
	else:
		L=[]
		for m in M:
			s,t,p,b=S,m,P,1
			for j in R(K):
				b*=t<=s
				s,t,p=s%p,t%p,p//5
			if b:L.append(m)
		for m in L:M.remove(m)
		M.add(S)
print(N-len(M))
0