結果

問題 No.1081 和の和
ユーザー ぷらぷら
提出日時 2021-02-19 16:55:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 1,434 ms
コンパイル使用メモリ 166,152 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-14 10:54:34
合計ジャッジ時間 2,217 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,352 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
ll mod = 1000000007;
int main() {
    int N;
    cin >> N;
    vector<ll>A(N);
    for(int i = 0; i < N; i++) cin >> A[i];
    for(int i = 1; i < N; i++) 
        for(int j = i; j < N-i+1; j++) {
            A[j-1] = A[j-1]+A[j];
            A[j-1] %= mod;
        }
    cout << A[0] << endl;
}
0