結果

問題 No.1629 Sorting Integers (SUM of M)
ユーザー yudai1102jpyudai1102jp
提出日時 2021-07-30 22:36:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 439 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,844 KB
実行使用メモリ 8,552 KB
最終ジャッジ日時 2023-10-14 06:06:24
合計ジャッジ時間 1,457 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,844 KB
testcase_01 AC 16 ms
7,912 KB
testcase_02 AC 16 ms
7,836 KB
testcase_03 AC 15 ms
7,836 KB
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 #

N = int(input())
c = list(map(int, input().split()))

MOD = 10**9+7


def bikkuri(n):
    if n == 1 or n == 0:
        return 1
    return (n*bikkuri(n-1)) % MOD


a = bikkuri(N-1)
b = 1

s = 0
for i in range(len(c)):
    if c[i] != 0:
        b *= bikkuri(c[i])
        b %= MOD
        # one = one*10+1
        s += (i+1)*c[i]

n = (a*pow(b, -1, MOD)) % MOD
n *= s
ans = 0
for i in range(N):
    ans = ans*10+n
    ans %= MOD
print(ans)
0