結果
| 問題 | 
                            No.1336 Union on Blackboard
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-01-15 22:07:28 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 48 ms / 2,000 ms | 
| コード長 | 219 bytes | 
| コンパイル時間 | 229 ms | 
| コンパイル使用メモリ | 81,968 KB | 
| 実行使用メモリ | 63,076 KB | 
| 最終ジャッジ日時 | 2024-11-26 14:59:49 | 
| 合計ジャッジ時間 | 2,571 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 31 | 
ソースコード
t = int(input())
for _ in range(t):
    n = int(input())
    a = list(map(int, input().split()))
    cur = a[0]
    for i in range(1, n):
        cur = cur + a[i] + cur * a[i]
        cur %= (10 ** 9 + 7)
    print(cur)