結果
| 問題 | No.1081 和の和 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-06-19 21:22:22 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 590 bytes | 
| コンパイル時間 | 1,046 ms | 
| コンパイル使用メモリ | 99,856 KB | 
| 最終ジャッジ日時 | 2025-01-11 05:35:11 | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 8 | 
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <math.h>
#include <deque>
#include <cstdio>
#include <queue>
#include <numeric>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
constexpr ll mod=1e9+7;
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<ll> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    for(int i=0;i<n-1;i++){
        for(int j=0;j<n-1-i;j++){
            a[j]=(a[j]+a[j+1])%mod;
        }
    }
    cout << a[0] << endl;
}
            
            
            
        