結果

問題 No.1629 Sorting Integers (SUM of M)
コンテスト
ユーザー SidewaysOwl
提出日時 2021-07-30 20:49:50
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
TLE  
実行時間 -
コード長 328 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 178 ms
コンパイル使用メモリ 85,120 KB
実行使用メモリ 113,884 KB
最終ジャッジ日時 2026-04-05 02:26:37
合計ジャッジ時間 3,983 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other TLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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