結果

問題 No.797 Noelちゃんとピラミッド
ユーザー titiatitia
提出日時 2019-03-15 21:37:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 468 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 10,564 KB
実行使用メモリ 19,908 KB
最終ジャッジ日時 2023-09-14 13:11:07
合計ジャッジ時間 17,164 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,740 KB
testcase_01 AC 17 ms
7,800 KB
testcase_02 AC 17 ms
7,740 KB
testcase_03 AC 465 ms
19,804 KB
testcase_04 AC 464 ms
19,812 KB
testcase_05 AC 466 ms
19,868 KB
testcase_06 AC 466 ms
19,732 KB
testcase_07 AC 465 ms
19,816 KB
testcase_08 AC 459 ms
19,908 KB
testcase_09 AC 464 ms
19,800 KB
testcase_10 AC 463 ms
19,796 KB
testcase_11 AC 465 ms
19,800 KB
testcase_12 AC 460 ms
19,812 KB
testcase_13 AC 464 ms
19,812 KB
testcase_14 AC 461 ms
19,868 KB
testcase_15 AC 467 ms
19,752 KB
testcase_16 AC 464 ms
19,696 KB
testcase_17 AC 465 ms
19,768 KB
testcase_18 AC 468 ms
19,876 KB
testcase_19 AC 466 ms
19,808 KB
testcase_20 AC 466 ms
19,692 KB
testcase_21 AC 466 ms
19,752 KB
testcase_22 AC 467 ms
19,880 KB
testcase_23 AC 334 ms
16,380 KB
testcase_24 AC 115 ms
11,392 KB
testcase_25 AC 283 ms
15,096 KB
testcase_26 AC 268 ms
14,640 KB
testcase_27 AC 456 ms
19,568 KB
testcase_28 AC 411 ms
18,468 KB
testcase_29 AC 72 ms
10,056 KB
testcase_30 AC 108 ms
10,376 KB
testcase_31 AC 333 ms
16,284 KB
testcase_32 AC 147 ms
11,544 KB
testcase_33 AC 276 ms
14,816 KB
testcase_34 AC 198 ms
12,828 KB
testcase_35 AC 467 ms
19,712 KB
testcase_36 AC 62 ms
9,236 KB
testcase_37 AC 404 ms
18,404 KB
testcase_38 AC 425 ms
18,768 KB
testcase_39 AC 275 ms
14,848 KB
testcase_40 AC 61 ms
9,328 KB
testcase_41 AC 86 ms
10,284 KB
testcase_42 AC 265 ms
14,480 KB
testcase_43 AC 16 ms
7,744 KB
testcase_44 AC 15 ms
7,824 KB
testcase_45 AC 15 ms
7,956 KB
testcase_46 AC 15 ms
7,808 KB
testcase_47 AC 15 ms
7,752 KB
testcase_48 AC 15 ms
7,912 KB
testcase_49 AC 16 ms
7,804 KB
testcase_50 AC 16 ms
7,812 KB
testcase_51 AC 16 ms
7,944 KB
testcase_52 AC 16 ms
7,924 KB
testcase_53 AC 16 ms
7,948 KB
testcase_54 AC 16 ms
7,876 KB
testcase_55 AC 16 ms
7,868 KB
testcase_56 AC 16 ms
7,812 KB
testcase_57 AC 16 ms
7,748 KB
testcase_58 AC 16 ms
7,816 KB
testcase_59 AC 16 ms
7,744 KB
testcase_60 AC 15 ms
7,912 KB
testcase_61 AC 16 ms
7,860 KB
testcase_62 AC 16 ms
7,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

mod=10**9+7

INV=[None]*(N+1)#1/aのリストを予め作っておく.
for i in range(1,N+1):
    INV[i]=pow(i,mod-2,mod)

#nCkは、nもしくはkが固定の場合はリストで作る

Combi=[None]*(N)#Combi[i]=n-1Ci を表す
Combi[0]=1
for i in range(1,N):
    Combi[i]=Combi[i-1]*(N-i)*INV[i] %mod

ANS=0
for i in range(N):
    ANS=(ANS+A[i]*Combi[i])%mod

print(ANS)
0