結果

問題 No.797 Noelちゃんとピラミッド
ユーザー しとお
提出日時 2019-03-15 23:22:26
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 400 bytes
コンパイル時間 569 ms
コンパイル使用メモリ 68,992 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-01 21:40:42
合計ジャッジ時間 3,757 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 57
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#define llong long long
using namespace std;


const llong mod=int(1e9)+7;

int main(){
    llong n;
    cin >> n;
    vector<llong>a(n);
    for(int i=0; i<n; i++)cin >> a[i];
    llong c=1;
    llong ret=0;
    for(int i=0; i<n; i++){
        ret+=a[i]*c;
        ret%=mod;
        c=(c*(n-i-1)/(llong)(i+1))%mod;
    }
    cout << ret << endl;
    return 0;
}
0