結果

問題 No.1629 Sorting Integers (SUM of M)
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-07-30 21:06:02
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 356 bytes
コンパイル時間 2,307 ms
コンパイル使用メモリ 86,780 KB
実行使用メモリ 75,588 KB
最終ジャッジ日時 2023-10-14 02:06:34
合計ジャッジ時間 4,417 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
75,588 KB
testcase_01 AC 72 ms
71,160 KB
testcase_02 AC 73 ms
71,384 KB
testcase_03 AC 73 ms
71,368 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
import math
n = int(input())
c = list(map(int,input().split()))
ans = 0
nn = math.factorial(n)
for i in range(9):
    if c[i] != 0:
        nn //= math.factorial(c[i])
ans = 0
for i in range(9):
    if c[i] != 0:
        for j in range(n):
            ans += (i+1) * 10 ** j * c[i] * (nn // n)
print(ans % (10 ** 9 + 7) )
0