結果

問題 No.797 Noelちゃんとピラミッド
ユーザー tanon710tanon710
提出日時 2020-10-04 01:36:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 204 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 105,004 KB
最終ジャッジ日時 2023-09-25 14:30:18
合計ジャッジ時間 13,657 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,412 KB
testcase_01 AC 72 ms
71,404 KB
testcase_02 AC 74 ms
71,296 KB
testcase_03 AC 198 ms
104,440 KB
testcase_04 AC 202 ms
104,392 KB
testcase_05 AC 199 ms
104,348 KB
testcase_06 AC 200 ms
104,492 KB
testcase_07 AC 203 ms
104,472 KB
testcase_08 AC 204 ms
104,312 KB
testcase_09 AC 203 ms
104,440 KB
testcase_10 AC 203 ms
104,376 KB
testcase_11 AC 200 ms
104,384 KB
testcase_12 AC 200 ms
104,412 KB
testcase_13 AC 200 ms
104,416 KB
testcase_14 AC 204 ms
104,424 KB
testcase_15 AC 204 ms
104,688 KB
testcase_16 AC 201 ms
104,444 KB
testcase_17 AC 202 ms
104,368 KB
testcase_18 AC 201 ms
104,480 KB
testcase_19 AC 203 ms
104,424 KB
testcase_20 AC 201 ms
104,436 KB
testcase_21 AC 200 ms
104,468 KB
testcase_22 AC 199 ms
104,380 KB
testcase_23 AC 171 ms
95,892 KB
testcase_24 AC 109 ms
79,936 KB
testcase_25 AC 153 ms
92,872 KB
testcase_26 AC 150 ms
91,264 KB
testcase_27 AC 200 ms
105,004 KB
testcase_28 AC 186 ms
101,944 KB
testcase_29 AC 95 ms
76,788 KB
testcase_30 AC 106 ms
79,848 KB
testcase_31 AC 165 ms
95,996 KB
testcase_32 AC 119 ms
82,788 KB
testcase_33 AC 151 ms
92,980 KB
testcase_34 AC 131 ms
87,216 KB
testcase_35 AC 201 ms
104,344 KB
testcase_36 AC 93 ms
76,732 KB
testcase_37 AC 186 ms
102,048 KB
testcase_38 AC 194 ms
104,048 KB
testcase_39 AC 153 ms
92,216 KB
testcase_40 AC 95 ms
76,684 KB
testcase_41 AC 103 ms
77,928 KB
testcase_42 AC 149 ms
91,044 KB
testcase_43 AC 73 ms
71,556 KB
testcase_44 AC 75 ms
71,140 KB
testcase_45 AC 75 ms
71,396 KB
testcase_46 AC 77 ms
71,388 KB
testcase_47 AC 79 ms
71,524 KB
testcase_48 AC 78 ms
71,448 KB
testcase_49 AC 77 ms
71,412 KB
testcase_50 AC 75 ms
71,300 KB
testcase_51 AC 74 ms
71,320 KB
testcase_52 AC 77 ms
71,424 KB
testcase_53 AC 76 ms
71,472 KB
testcase_54 AC 74 ms
71,420 KB
testcase_55 AC 74 ms
71,400 KB
testcase_56 AC 77 ms
71,324 KB
testcase_57 AC 75 ms
71,400 KB
testcase_58 AC 75 ms
71,172 KB
testcase_59 AC 76 ms
71,392 KB
testcase_60 AC 74 ms
71,388 KB
testcase_61 AC 77 ms
71,324 KB
testcase_62 AC 75 ms
71,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=10**9+7

n=int(input())
arr=list(map(int,input().split()))
fact=[1]
revfact=[1]
for i in range(1,n+1):
    fact.append((fact[-1]*i)%mod)
    revfact.append(pow(fact[-1],mod-2,mod))
ans=0
for i in range(n):
    ans+=arr[i]*fact[n-1]*revfact[i]*revfact[n-1-i]
    ans%=mod
print(ans)
0