結果

問題 No.1629 Sorting Integers (SUM of M)
ユーザー PSL24251284PSL24251284
提出日時 2021-07-30 23:37:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 372 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 87,252 KB
実行使用メモリ 89,632 KB
最終ジャッジ日時 2023-10-14 08:41:43
合計ジャッジ時間 2,486 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,188 KB
testcase_01 AC 64 ms
71,284 KB
testcase_02 AC 61 ms
71,472 KB
testcase_03 AC 62 ms
71,360 KB
testcase_04 AC 71 ms
81,224 KB
testcase_05 AC 65 ms
76,244 KB
testcase_06 AC 64 ms
76,376 KB
testcase_07 AC 72 ms
83,988 KB
testcase_08 AC 68 ms
81,416 KB
testcase_09 AC 68 ms
82,220 KB
testcase_10 AC 66 ms
81,460 KB
testcase_11 AC 67 ms
79,152 KB
testcase_12 AC 71 ms
82,080 KB
testcase_13 AC 68 ms
82,268 KB
testcase_14 AC 66 ms
79,920 KB
testcase_15 AC 68 ms
83,072 KB
testcase_16 AC 70 ms
82,136 KB
testcase_17 AC 73 ms
89,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9+7
N = int(input())
c = [0] + list(map(int,input().split()))
P = [1]
for i in range(1,N+1):
    P.append((P[-1]*i)%mod)
#print(P)
X = P[N-1]
for i in range(10):
    X *= pow(P[c[i]],mod-2,mod)
    X %= mod

X *= pow(10,N,mod)-1
X %= mod
X *= pow(9,mod-2,mod)
X %= mod

ans = 0
for i in range(10):
    ans += i*c[i]
    ans %= mod

ans *= X
ans %= mod
print(ans)
0