結果

問題 No.797 Noelちゃんとピラミッド
ユーザー roarisroaris
提出日時 2019-08-12 10:36:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 269 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 1,420 ms
コンパイル使用メモリ 85,812 KB
実行使用メモリ 99,404 KB
最終ジャッジ日時 2023-10-13 10:30:05
合計ジャッジ時間 15,225 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,512 KB
testcase_01 AC 70 ms
71,360 KB
testcase_02 AC 70 ms
71,464 KB
testcase_03 AC 264 ms
99,308 KB
testcase_04 AC 263 ms
99,204 KB
testcase_05 AC 262 ms
99,304 KB
testcase_06 AC 263 ms
99,224 KB
testcase_07 AC 263 ms
99,340 KB
testcase_08 AC 265 ms
99,124 KB
testcase_09 AC 261 ms
99,340 KB
testcase_10 AC 266 ms
99,404 KB
testcase_11 AC 269 ms
99,344 KB
testcase_12 AC 266 ms
99,224 KB
testcase_13 AC 266 ms
99,336 KB
testcase_14 AC 269 ms
99,216 KB
testcase_15 AC 268 ms
99,312 KB
testcase_16 AC 268 ms
99,328 KB
testcase_17 AC 266 ms
99,332 KB
testcase_18 AC 265 ms
99,308 KB
testcase_19 AC 264 ms
99,336 KB
testcase_20 AC 265 ms
99,396 KB
testcase_21 AC 265 ms
99,316 KB
testcase_22 AC 264 ms
99,308 KB
testcase_23 AC 214 ms
92,360 KB
testcase_24 AC 126 ms
79,528 KB
testcase_25 AC 194 ms
90,428 KB
testcase_26 AC 187 ms
88,900 KB
testcase_27 AC 261 ms
99,280 KB
testcase_28 AC 241 ms
96,756 KB
testcase_29 AC 111 ms
77,664 KB
testcase_30 AC 124 ms
79,488 KB
testcase_31 AC 214 ms
92,144 KB
testcase_32 AC 138 ms
82,020 KB
testcase_33 AC 192 ms
90,276 KB
testcase_34 AC 160 ms
85,208 KB
testcase_35 AC 265 ms
99,324 KB
testcase_36 AC 106 ms
77,656 KB
testcase_37 AC 244 ms
96,692 KB
testcase_38 AC 253 ms
97,892 KB
testcase_39 AC 191 ms
89,900 KB
testcase_40 AC 106 ms
77,544 KB
testcase_41 AC 115 ms
78,108 KB
testcase_42 AC 187 ms
88,984 KB
testcase_43 AC 74 ms
71,412 KB
testcase_44 AC 73 ms
71,244 KB
testcase_45 AC 74 ms
71,328 KB
testcase_46 AC 73 ms
71,360 KB
testcase_47 AC 72 ms
71,244 KB
testcase_48 AC 73 ms
71,364 KB
testcase_49 AC 72 ms
71,440 KB
testcase_50 AC 73 ms
71,220 KB
testcase_51 AC 72 ms
71,416 KB
testcase_52 AC 72 ms
71,252 KB
testcase_53 AC 72 ms
71,376 KB
testcase_54 AC 72 ms
71,192 KB
testcase_55 AC 72 ms
71,300 KB
testcase_56 AC 73 ms
71,404 KB
testcase_57 AC 72 ms
71,604 KB
testcase_58 AC 72 ms
71,464 KB
testcase_59 AC 74 ms
71,640 KB
testcase_60 AC 73 ms
71,372 KB
testcase_61 AC 73 ms
71,444 KB
testcase_62 AC 72 ms
71,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def inv(x):
    return pow(x, MOD-2, MOD)

def C(n, r):
    return fact[n] * inv(fact[r]) * inv(fact[n-r])

N = int(input())
a = list(map(int, input().split()))
MOD = 10 ** 9 + 7

fact = [1]

for i in range(1, N+1):
    fact.append(fact[-1] * i % MOD)
    
ans = 0

for i in range(N):
    ans += C(N-1, i) * a[i]
    ans %= MOD

print(ans)
0