結果

問題 No.1629 Sorting Integers (SUM of M)
ユーザー とりゐとりゐ
提出日時 2021-07-05 12:51:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 298 bytes
コンパイル時間 748 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 77,452 KB
最終ジャッジ日時 2023-10-14 01:42:41
合計ジャッジ時間 3,050 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,060 KB
testcase_01 AC 77 ms
71,000 KB
testcase_02 AC 74 ms
71,152 KB
testcase_03 AC 73 ms
71,152 KB
testcase_04 AC 78 ms
76,340 KB
testcase_05 AC 79 ms
75,732 KB
testcase_06 AC 78 ms
75,800 KB
testcase_07 AC 78 ms
76,484 KB
testcase_08 AC 78 ms
76,472 KB
testcase_09 AC 79 ms
76,304 KB
testcase_10 AC 78 ms
76,332 KB
testcase_11 AC 78 ms
76,140 KB
testcase_12 AC 77 ms
76,432 KB
testcase_13 AC 79 ms
76,820 KB
testcase_14 AC 79 ms
76,204 KB
testcase_15 AC 80 ms
76,328 KB
testcase_16 AC 77 ms
76,276 KB
testcase_17 AC 80 ms
77,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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