結果

問題 No.1336 Union on Blackboard
ユーザー Manuel1024
提出日時 2021-05-04 23:12:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 890 ms
コンパイル使用メモリ 69,612 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-23 18:18:29
合計ジャッジ時間 1,842 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
using ll = long long int;
const ll MOD = 1000000007;

int main(){
    int t;
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        vector<ll> a(n);
        for(auto &p: a) cin >> p;
        ll ans = 1;
        for(auto &p: a){
            ans *= p+1;
            ans %= MOD;
        }
        ans--;
        ans += MOD;
        cout << ans%MOD << endl;
    }
    return 0;
}
0