結果

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

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

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

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