結果

問題 No.1629 Sorting Integers (SUM of M)
ユーザー tassei903tassei903
提出日時 2021-07-30 21:12:03
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 634 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 263,532 KB
最終ジャッジ日時 2023-10-14 02:38:30
合計ジャッジ時間 7,526 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
75,692 KB
testcase_01 AC 73 ms
71,132 KB
testcase_02 AC 73 ms
71,264 KB
testcase_03 AC 74 ms
71,296 KB
testcase_04 TLE -
testcase_05 AC 221 ms
77,120 KB
testcase_06 AC 298 ms
77,332 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
sys.setrecursionlimit(10**7)
yes = lambda :print("yes");Yes = lambda :print("Yes")
no = lambda :print("no");No = lambda :print("No")
#######################################################################

n = ni()
c = na()
mod = 10**9+7
z = 1
f = 1
for i in range(1,n):
    f*=i
for i in range(9):
    for j in range(1,c[i]+1):
        f*=pow(j,mod-2,mod)
        f%=mod
ans = 0
for i in range(n):
    for j in range(9):
        ans+=f*z%mod*c[j]%mod*(j+1)%mod
        ans%=mod
    z*=10
    z%=mod
print(ans)
0