結果
問題 | No.2178 Payable Magic Items |
ユーザー | rlangevin |
提出日時 | 2023-03-18 23:30:47 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,366 ms / 4,000 ms |
コード長 | 3,620 bytes |
コンパイル時間 | 162 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 136,788 KB |
最終ジャッジ日時 | 2024-09-18 13:37:35 |
合計ジャッジ時間 | 30,669 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 872 ms
114,780 KB |
testcase_01 | AC | 904 ms
114,848 KB |
testcase_02 | AC | 899 ms
114,776 KB |
testcase_03 | AC | 895 ms
115,316 KB |
testcase_04 | AC | 872 ms
114,716 KB |
testcase_05 | AC | 881 ms
114,864 KB |
testcase_06 | AC | 880 ms
114,828 KB |
testcase_07 | AC | 879 ms
114,756 KB |
testcase_08 | AC | 893 ms
114,732 KB |
testcase_09 | AC | 873 ms
114,744 KB |
testcase_10 | AC | 876 ms
114,612 KB |
testcase_11 | AC | 1,335 ms
136,388 KB |
testcase_12 | AC | 1,366 ms
136,140 KB |
testcase_13 | AC | 1,363 ms
136,788 KB |
testcase_14 | AC | 1,357 ms
136,272 KB |
testcase_15 | AC | 1,364 ms
136,704 KB |
testcase_16 | AC | 1,365 ms
136,188 KB |
testcase_17 | AC | 1,058 ms
121,076 KB |
testcase_18 | AC | 931 ms
115,548 KB |
testcase_19 | AC | 1,004 ms
119,140 KB |
testcase_20 | AC | 915 ms
114,952 KB |
testcase_21 | AC | 920 ms
115,716 KB |
testcase_22 | AC | 925 ms
115,592 KB |
testcase_23 | AC | 885 ms
115,588 KB |
testcase_24 | AC | 1,230 ms
129,660 KB |
testcase_25 | AC | 968 ms
117,024 KB |
testcase_26 | AC | 1,026 ms
121,728 KB |
ソースコード
import sys readline = sys.stdin.readline N, K = map(int, readline().split()) D = [[[[[[[[0] * 6 for _ in range(6)] for _ in range(6)] for _ in range(6)] for _ in range(6)] for _ in range(6)] for _ in range(6)] for _ in range(6)] S = [] for i in range(N): s = readline().rstrip() s = str(s).zfill(8) s = list(s) s = list(map(int, s)) s = list(map(lambda x : 4 - x, s)) s = list(map(str, s)) s = "".join(s) S.append(s) i,j,k,l,m,n,o,p = map(int,s) D[i + 1][j + 1][k + 1][l + 1][m + 1][n + 1][o + 1][p + 1] += 1 for i in range(6): for j in range(6): for k in range(6): for l in range(6): for m in range(6): for n in range(6): for o in range(6): for p in range(5): D[i][j][k][l][m][n][o][p + 1] += D[i][j][k][l][m][n][o][p] for i in range(6): for j in range(6): for k in range(6): for l in range(6): for m in range(6): for n in range(6): for o in range(5): for p in range(6): D[i][j][k][l][m][n][o + 1][p] += D[i][j][k][l][m][n][o][p] for i in range(6): for j in range(6): for k in range(6): for l in range(6): for m in range(6): for n in range(5): for o in range(6): for p in range(6): D[i][j][k][l][m][n + 1][o][p] += D[i][j][k][l][m][n][o][p] for i in range(6): for j in range(6): for k in range(6): for l in range(6): for m in range(5): for n in range(6): for o in range(6): for p in range(6): D[i][j][k][l][m + 1][n][o][p] += D[i][j][k][l][m][n][o][p] for i in range(6): for j in range(6): for k in range(6): for l in range(5): for m in range(6): for n in range(6): for o in range(6): for p in range(6): D[i][j][k][l + 1][m][n][o][p] += D[i][j][k][l][m][n][o][p] for i in range(6): for j in range(6): for k in range(5): for l in range(6): for m in range(6): for n in range(6): for o in range(6): for p in range(6): D[i][j][k + 1][l][m][n][o][p] += D[i][j][k][l][m][n][o][p] for i in range(6): for j in range(5): for k in range(6): for l in range(6): for m in range(6): for n in range(6): for o in range(6): for p in range(6): D[i][j + 1][k][l][m][n][o][p] += D[i][j][k][l][m][n][o][p] for i in range(5): for j in range(6): for k in range(6): for l in range(6): for m in range(6): for n in range(6): for o in range(6): for p in range(6): D[i + 1][j][k][l][m][n][o][p] += D[i][j][k][l][m][n][o][p] ans = 0 for s in S: i,j,k,l,m,n,o,p = map(int,s) if D[i + 1][j + 1][k + 1][l + 1][m + 1][n + 1][o + 1][p + 1] >= 2: ans += 1 print(ans)