結果

問題 No.797 Noelちゃんとピラミッド
ユーザー imulanimulan
提出日時 2019-03-16 00:59:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 502 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 10,876 KB
実行使用メモリ 27,052 KB
最終ジャッジ日時 2023-09-14 14:58:26
合計ジャッジ時間 30,788 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 380 ms
15,836 KB
testcase_01 AC 386 ms
15,788 KB
testcase_02 AC 386 ms
15,744 KB
testcase_03 AC 496 ms
26,944 KB
testcase_04 AC 493 ms
27,036 KB
testcase_05 AC 502 ms
26,944 KB
testcase_06 AC 493 ms
26,900 KB
testcase_07 AC 496 ms
26,944 KB
testcase_08 AC 498 ms
27,052 KB
testcase_09 AC 491 ms
26,944 KB
testcase_10 AC 495 ms
26,948 KB
testcase_11 AC 502 ms
26,892 KB
testcase_12 AC 483 ms
27,004 KB
testcase_13 AC 488 ms
27,000 KB
testcase_14 AC 499 ms
27,028 KB
testcase_15 AC 494 ms
27,044 KB
testcase_16 AC 496 ms
26,944 KB
testcase_17 AC 496 ms
27,008 KB
testcase_18 AC 497 ms
27,000 KB
testcase_19 AC 495 ms
26,996 KB
testcase_20 AC 497 ms
26,944 KB
testcase_21 AC 496 ms
26,940 KB
testcase_22 AC 495 ms
26,964 KB
testcase_23 AC 467 ms
23,712 KB
testcase_24 AC 407 ms
18,312 KB
testcase_25 AC 453 ms
22,656 KB
testcase_26 AC 443 ms
22,056 KB
testcase_27 AC 496 ms
26,608 KB
testcase_28 AC 479 ms
25,684 KB
testcase_29 AC 403 ms
17,300 KB
testcase_30 AC 407 ms
18,076 KB
testcase_31 AC 464 ms
23,772 KB
testcase_32 AC 418 ms
19,084 KB
testcase_33 AC 448 ms
22,412 KB
testcase_34 AC 434 ms
20,256 KB
testcase_35 AC 500 ms
27,012 KB
testcase_36 AC 394 ms
17,060 KB
testcase_37 AC 483 ms
25,268 KB
testcase_38 AC 486 ms
26,160 KB
testcase_39 AC 445 ms
22,172 KB
testcase_40 AC 396 ms
17,160 KB
testcase_41 AC 395 ms
17,600 KB
testcase_42 AC 443 ms
22,084 KB
testcase_43 AC 385 ms
15,856 KB
testcase_44 AC 385 ms
15,816 KB
testcase_45 AC 388 ms
15,852 KB
testcase_46 AC 385 ms
15,780 KB
testcase_47 AC 385 ms
15,824 KB
testcase_48 AC 386 ms
15,776 KB
testcase_49 AC 387 ms
15,696 KB
testcase_50 AC 383 ms
15,820 KB
testcase_51 AC 389 ms
15,784 KB
testcase_52 AC 388 ms
15,756 KB
testcase_53 AC 387 ms
15,816 KB
testcase_54 AC 392 ms
15,752 KB
testcase_55 AC 387 ms
15,700 KB
testcase_56 AC 392 ms
15,780 KB
testcase_57 AC 382 ms
15,752 KB
testcase_58 AC 381 ms
15,740 KB
testcase_59 AC 382 ms
15,756 KB
testcase_60 AC 382 ms
15,752 KB
testcase_61 AC 387 ms
15,780 KB
testcase_62 AC 388 ms
15,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9 + 7

N = 100010
f = [1 for i in range(N)]
invf = [1 for i in range(N)]

for i in range(1,N):
    f[i] = (f[i-1]*i)%mod
    invf[i] = pow(f[i], mod-2, mod)

n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in range(n):
    C = f[n-1]
    C *= invf[i]
    C *= invf[n-1-i]
    ans += C*a[i]
    ans %= mod
print(ans)
0