結果

問題 No.1631 Sorting Integers (Multiple of K) Easy
ユーザー lloyzlloyz
提出日時 2021-12-27 22:58:39
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 380 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 263,668 KB
最終ジャッジ日時 2024-04-08 17:36:54
合計ジャッジ時間 5,855 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 41 ms
53,460 KB
testcase_02 AC 42 ms
53,460 KB
testcase_03 AC 255 ms
115,620 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 38 ms
53,460 KB
testcase_06 AC 37 ms
53,460 KB
testcase_07 AC 38 ms
53,460 KB
testcase_08 AC 37 ms
53,460 KB
testcase_09 AC 48 ms
64,436 KB
testcase_10 AC 52 ms
64,436 KB
testcase_11 AC 48 ms
64,428 KB
testcase_12 AC 41 ms
59,352 KB
testcase_13 AC 47 ms
64,428 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

n, k = map(int, input().split())
C = list(map(int, input().split()))
L = []
for i in range(9):
    for num in range(C[i]):
        L.append(str(i + 1))

ans = 0
seen = set()
for P in permutations(L):
    num = ''.join(P)
    num = int(num)
    if num in seen:
        continue
    seen.add(num)
    if num % k == 0:
        ans += 1
print(ans)
0