結果

問題 No.797 Noelちゃんとピラミッド
ユーザー yapoo
提出日時 2019-03-15 21:36:37
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 367 bytes
コンパイル時間 1,289 ms
コンパイル使用メモリ 159,348 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-01 20:32:53
合計ジャッジ時間 4,721 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 49
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
    int N;  cin >> N;
    vector<int> a(N);
    for(int i=0; i<N; i++) cin >> a[i];

    ll mod = 1e9+7;
    ll ans = 0;
    ll c = 1;
    for(int i=0; i<N; i++){
        ans += ((c%mod)*a[i])%mod;
        ans = ans%mod;
        c = (N-1-i)*c/(i+1);
    }
    cout << ans << endl;    
}
0