結果

問題 No.1629 Sorting Integers (SUM of M)
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-07-30 20:49:50
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 328 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 113,044 KB
最終ジャッジ日時 2023-10-14 03:06:26
合計ジャッジ時間 4,430 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
78,384 KB
testcase_01 AC 77 ms
71,228 KB
testcase_02 AC 76 ms
71,216 KB
testcase_03 AC 232 ms
113,044 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
n = int(input())
c = list(map(int,input().split()))
ans = []
for i in range(8,-1,-1):
    for j in range(c[i]):
         ans.append((i+1))
s = set()
for pt in permutations(ans):
    p = 0
    for i in range(n):
        p += int(pt[i]) * 10 ** i
    s.add(p)
print(sum(list(s)) % (10 ** 9 + 7))
0