結果

問題 No.1629 Sorting Integers (SUM of M)
ユーザー c-yanc-yan
提出日時 2021-07-31 04:35:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 495 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 7,960 KB
最終ジャッジ日時 2023-10-14 14:02:59
合計ジャッジ時間 1,744 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

m = 1000000007

N, *c = map(int, open(0).read().split())

fac = [1] * 10
for i in range(9):
    fac[i + 1] = fac[i] * (i + 1)
    fac[i + 1] %= m

x = pow(10, N, m)
result = 0
for i in range(9):
    result += c[i] * (i + 1) * x
    result %= m
for i in range(9):
    result *= pow(fac[c[i]], -1, m)
    result %= m
print(result)
0