結果

問題 No.1336 Union on Blackboard
ユーザー merom686merom686
提出日時 2021-01-15 21:31:32
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 575 bytes
コンパイル時間 925 ms
コンパイル使用メモリ 88,320 KB
最終ジャッジ日時 2025-01-17 18:38:36
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
using ll = long long;

constexpr int P = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin >> t;

    while (t--) {
        int n;
        cin >> n;

        ll r = 1;
        for (int i = 0; i < n; i++) {
            int a;
            cin >> a;

            r = r * (a + 1) % P;
        }
        r += P - 1;
        r %= P;

        cout << r << '\n';
    }

    return 0;
}
0