結果

問題 No.1629 Sorting Integers (SUM of M)
ユーザー とりゐとりゐ
提出日時 2021-07-30 03:01:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 348 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 77,288 KB
最終ジャッジ日時 2023-10-14 02:38:54
合計ジャッジ時間 2,558 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,432 KB
testcase_01 AC 74 ms
71,232 KB
testcase_02 AC 71 ms
70,964 KB
testcase_03 AC 70 ms
71,440 KB
testcase_04 AC 81 ms
76,280 KB
testcase_05 AC 74 ms
75,688 KB
testcase_06 AC 75 ms
75,772 KB
testcase_07 AC 74 ms
76,468 KB
testcase_08 AC 77 ms
76,232 KB
testcase_09 AC 76 ms
76,404 KB
testcase_10 AC 78 ms
76,496 KB
testcase_11 AC 74 ms
76,052 KB
testcase_12 AC 76 ms
76,588 KB
testcase_13 AC 76 ms
76,400 KB
testcase_14 AC 75 ms
76,128 KB
testcase_15 AC 77 ms
76,676 KB
testcase_16 AC 76 ms
76,700 KB
testcase_17 AC 78 ms
77,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
c=list(map(int,input().split()))
fact=[1]*(n+1)
mod=10**9+7
for i in range(1,n+1):
  fact[i]=fact[i-1]*i%mod
ans=fact[n-1]*(pow(10,n,mod)-1)*pow(9,mod-2,mod)%mod
for i in c:
  ans=ans*pow(fact[i],mod-2,mod)%mod
num=0
for i in range(9):
  num+=(i+1)*c[i]
print(num*ans%mod)
0