結果

問題 No.797 Noelちゃんとピラミッド
コンテスト
ユーザー Yoshinari Takaoka
提出日時 2019-03-16 03:40:20
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 662 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,190 ms
コンパイル使用メモリ 184,384 KB
実行使用メモリ 22,072 KB
最終ジャッジ日時 2026-03-23 01:18:42
合計ジャッジ時間 106,962 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 25 TLE * 32
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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;
}
0