結果

問題 No.797 Noelちゃんとピラミッド
ユーザー qqr_i
提出日時 2019-03-15 22:36:50
言語 Python3
(3.7.1 + numpy 1.14.5 + scipy 1.1.0)
結果
WA   .
実行時間 -
コード長 219 Byte
コンパイル時間 44 ms
使用メモリ 16,412 KB
最終ジャッジ日時 2019-05-07 13:35:07

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
001sample.txt AC 19 ms
6,868 KB
002sample.txt AC 18 ms
6,872 KB
003sample.txt AC 18 ms
8,916 KB
LEARGE_case1.txt WA -
LEARGE_case2.txt WA -
LEARGE_case3.txt WA -
LEARGE_case4.txt WA -
LEARGE_case5.txt WA -
LEARGE_case6.txt WA -
LEARGE_case7.txt WA -
LEARGE_case8.txt WA -
LEARGE_case9.txt WA -
LEARGE_case10.txt WA -
LEARGE_case11.txt WA -
LEARGE_case12.txt WA -
LEARGE_case13.txt WA -
LEARGE_case14.txt WA -
LEARGE_case15.txt WA -
LEARGE_case16.txt WA -
LEARGE_case17.txt WA -
LEARGE_case18.txt WA -
LEARGE_case19.txt WA -
LEARGE_case20.txt WA -
RANDOM_case1.txt WA -
RANDOM_case2.txt WA -
RANDOM_case3.txt WA -
RANDOM_case4.txt WA -
RANDOM_case5.txt WA -
RANDOM_case6.txt WA -
RANDOM_case7.txt WA -
RANDOM_case8.txt WA -
RANDOM_case9.txt WA -
RANDOM_case10.txt WA -
RANDOM_case11.txt WA -
RANDOM_case12.txt WA -
RANDOM_case13.txt WA -
RANDOM_case14.txt WA -
RANDOM_case15.txt WA -
RANDOM_case16.txt WA -
RANDOM_case17.txt WA -
RANDOM_case18.txt WA -
RANDOM_case19.txt WA -
RANDOM_case20.txt WA -
SMALL_case1.txt WA -
SMALL_case2.txt WA -
SMALL_case3.txt WA -
SMALL_case4.txt WA -
SMALL_case5.txt AC 18 ms
6,872 KB
SMALL_case6.txt WA -
SMALL_case7.txt WA -
SMALL_case8.txt WA -
SMALL_case9.txt WA -
SMALL_case10.txt WA -
SMALL_case11.txt WA -
SMALL_case12.txt AC 18 ms
6,868 KB
SMALL_case13.txt WA -
SMALL_case14.txt WA -
SMALL_case15.txt WA -
SMALL_case16.txt AC 18 ms
6,872 KB
SMALL_case17.txt WA -
SMALL_case18.txt WA -
SMALL_case19.txt WA -
SMALL_case20.txt WA -
テストケース一括ダウンロード

ソースコード

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

C = 1
x = 1
y = N-1

ans = A[0] + A[-1]

for i in range(1,N-1) :
    C = (C * y // x)%(10**9+7)
    x += 1
    y -= 1
    ans += A[i]*C
    ans %= 10**9+7
print(ans)
0