結果

問題 No.797 Noelちゃんとピラミッド
ユーザー 👑 KazunKazun
提出日時 2020-05-31 18:00:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 408 ms
コンパイル使用メモリ 82,380 KB
実行使用メモリ 99,584 KB
最終ジャッジ日時 2024-04-29 00:15:47
合計ジャッジ時間 7,466 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,584 KB
testcase_01 AC 41 ms
52,224 KB
testcase_02 AC 39 ms
52,352 KB
testcase_03 AC 94 ms
99,072 KB
testcase_04 AC 95 ms
99,328 KB
testcase_05 AC 104 ms
99,456 KB
testcase_06 AC 97 ms
99,072 KB
testcase_07 AC 98 ms
99,584 KB
testcase_08 AC 97 ms
99,460 KB
testcase_09 AC 96 ms
99,200 KB
testcase_10 AC 98 ms
99,072 KB
testcase_11 AC 99 ms
99,556 KB
testcase_12 AC 96 ms
99,072 KB
testcase_13 AC 94 ms
99,104 KB
testcase_14 AC 99 ms
99,200 KB
testcase_15 AC 95 ms
99,456 KB
testcase_16 AC 93 ms
99,080 KB
testcase_17 AC 99 ms
99,328 KB
testcase_18 AC 95 ms
99,216 KB
testcase_19 AC 97 ms
99,584 KB
testcase_20 AC 96 ms
99,072 KB
testcase_21 AC 97 ms
99,328 KB
testcase_22 AC 96 ms
99,488 KB
testcase_23 AC 85 ms
91,504 KB
testcase_24 AC 56 ms
70,912 KB
testcase_25 AC 79 ms
88,960 KB
testcase_26 AC 71 ms
85,632 KB
testcase_27 AC 93 ms
98,816 KB
testcase_28 AC 88 ms
96,004 KB
testcase_29 AC 54 ms
66,944 KB
testcase_30 AC 59 ms
70,528 KB
testcase_31 AC 80 ms
91,240 KB
testcase_32 AC 65 ms
74,496 KB
testcase_33 AC 75 ms
87,680 KB
testcase_34 AC 69 ms
79,960 KB
testcase_35 AC 104 ms
99,072 KB
testcase_36 AC 54 ms
65,280 KB
testcase_37 AC 90 ms
96,128 KB
testcase_38 AC 90 ms
98,092 KB
testcase_39 AC 77 ms
86,528 KB
testcase_40 AC 53 ms
65,792 KB
testcase_41 AC 59 ms
67,968 KB
testcase_42 AC 75 ms
85,504 KB
testcase_43 AC 41 ms
52,096 KB
testcase_44 AC 41 ms
52,096 KB
testcase_45 AC 42 ms
52,096 KB
testcase_46 AC 40 ms
52,480 KB
testcase_47 AC 42 ms
51,968 KB
testcase_48 AC 41 ms
51,840 KB
testcase_49 AC 41 ms
51,584 KB
testcase_50 AC 40 ms
51,840 KB
testcase_51 AC 42 ms
51,968 KB
testcase_52 AC 42 ms
51,712 KB
testcase_53 AC 39 ms
52,608 KB
testcase_54 AC 41 ms
51,968 KB
testcase_55 AC 41 ms
51,968 KB
testcase_56 AC 39 ms
52,224 KB
testcase_57 AC 39 ms
52,480 KB
testcase_58 AC 39 ms
51,968 KB
testcase_59 AC 38 ms
52,352 KB
testcase_60 AC 40 ms
51,840 KB
testcase_61 AC 42 ms
52,096 KB
testcase_62 AC 41 ms
52,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M=10**9+7
N=int(input())

F=[1]
for i in range(1,N+1):
    F.append((F[-1]*i)%M)

G=[0]*(N+1)
G[N]=pow(F[N],M-2,M)

for i in range(N-1,-1,-1):
    G[i]=(G[i+1]*(i+1))%M

def nCr(n,r):
    if r<0 or n<r:
        return 0
    else:
        return (F[n]*G[r]*G[n-r])%M

A=list(map(int,input().split()))
S=0

for i in range(N):
    S=(S+A[i]*nCr(N-1,i))%M

print(S)
0