結果
| 問題 | No.1081 和の和 | 
| コンテスト | |
| ユーザー |  坊や | 
| 提出日時 | 2020-06-25 22:57:02 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 655 bytes | 
| コンパイル時間 | 1,441 ms | 
| コンパイル使用メモリ | 166,036 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-03 21:54:52 | 
| 合計ジャッジ時間 | 1,798 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 8 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const int inf = 1e9;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define per(i, b, a) for (int i = a - 1; i >= b; i--)
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dxx[8] = {1, 1, 1, 0, 0, -1, -1, -1}, dyy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
int main() {
    int n;
    cin >> n;
    ll a[n];
    rep (i, 0, n) { cin >> a[i]; }
    ll sum = 0;
    ll mod = 1e9 + 7;
    rep (i, 0, n - 1) {
        rep (j, 0, n - i - 1) { a[j] = (a[j] + a[j + 1]) % mod; }
    }
    cout << a[0] << "\n";
}
            
            
            
        