結果
| 問題 | 
                            No.1336 Union on Blackboard
                             | 
                    
| コンテスト | |
| ユーザー | 
                             蜜蜂
                         | 
                    
| 提出日時 | 2020-12-11 18:04:31 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 5 ms / 2,000 ms | 
| コード長 | 352 bytes | 
| コンパイル時間 | 1,554 ms | 
| コンパイル使用メモリ | 165,508 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-22 14:50:29 | 
| 合計ジャッジ時間 | 2,965 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 31 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
constexpr ll mod=1e9+7;
void solve(){
  int n;
  cin>>n;
  ll ans=1;
  for(int i=0;i<n;i++){
    ll a;
    cin>>a;
    ans*=(a+1);
    ans%=mod;
  }
  cout<<(mod+ans-1)%mod<<endl;
}
int main(){
  int t;
  cin>>t;
  while(t--){
    solve();
  }
}
            
            
            
        
            
蜜蜂