結果
| 問題 |
No.1336 Union on Blackboard
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-01-17 15:23:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 589 bytes |
| コンパイル時間 | 1,932 ms |
| コンパイル使用メモリ | 193,528 KB |
| 最終ジャッジ日時 | 2025-01-18 01:11:06 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 31 |
ソースコード
//#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
return (ull)rng() % B;
}
constexpr ll mod=1e9+7;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int q; cin >> q;
while(q--){
int n; cin >> n;
ll res=1;
for(int i=0;i<n;i++){
ll a; cin >> a;
res*=(a+1);
res%=mod;
}
cout << (res-1+mod)%mod << endl;
}
}