結果
| 問題 | 
                            No.797 Noelちゃんとピラミッド
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-03-16 03:40:20 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 662 bytes | 
| コンパイル時間 | 1,565 ms | 
| コンパイル使用メモリ | 170,124 KB | 
| 実行使用メモリ | 13,752 KB | 
| 最終ジャッジ日時 | 2024-07-01 22:17:42 | 
| 合計ジャッジ時間 | 5,381 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | TLE * 1 -- * 59 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
vector<int64_t> newarr(vector<int64_t> &orig) {
    vector<int64_t> newarr;
    int sz = orig.size();
    for (int j = 0; j < sz; j++) {
        if (j + 1 < sz) {
            int64_t one = orig[j];
            int64_t other = orig[j + 1];
            newarr.push_back(one + other);
        }
    }
    return newarr;
}
int main(int argc, char *argv[]) {
    int N;
    cin >> N;
    vector<int64_t> arr(N);
    for (int i = 0; i < N; i++) {
        cin >> arr[i];
    }
    while (arr.size() != 1) {
        arr = newarr(arr);
    }
    int64_t ans = arr[0] % 1000000007;
    cout << ans << endl;
	return 0;
}