結果
問題 |
No.2178 Payable Magic Items
|
ユーザー |
![]() |
提出日時 | 2023-01-07 01:17:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 369 bytes |
コンパイル時間 | 351 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 198,580 KB |
最終ジャッジ日時 | 2024-12-14 18:25:18 |
合計ジャッジ時間 | 64,504 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 11 WA * 3 TLE * 9 |
ソースコード
n,k = map(int,input().split()) a = {tuple(map(int,input())) for _ in range(n)} d = {} for i in range(5**k): t = [] for _ in range(k): t.append(i%5); i //= 5 t = tuple(t); f = False for j in range(k): if t[j]: u = list(t); u[j] -= 1; u = tuple(u) f |= u in a or d[u] d[t] = f ans = 0 for s in a: ans += d[s] print(ans)