結果

問題 No.1336 Union on Blackboard
ユーザー 👑 rin204rin204
提出日時 2022-01-18 18:49:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 240 bytes
コンパイル時間 855 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 76,316 KB
最終ジャッジ日時 2023-08-15 07:35:33
合計ジャッジ時間 5,004 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,484 KB
testcase_01 AC 82 ms
76,068 KB
testcase_02 AC 85 ms
76,192 KB
testcase_03 AC 86 ms
75,972 KB
testcase_04 AC 87 ms
76,092 KB
testcase_05 AC 87 ms
76,196 KB
testcase_06 AC 87 ms
75,920 KB
testcase_07 AC 87 ms
76,080 KB
testcase_08 AC 86 ms
76,240 KB
testcase_09 AC 88 ms
76,092 KB
testcase_10 AC 86 ms
76,100 KB
testcase_11 AC 88 ms
76,156 KB
testcase_12 AC 87 ms
76,316 KB
testcase_13 AC 89 ms
76,244 KB
testcase_14 AC 90 ms
75,920 KB
testcase_15 AC 87 ms
76,248 KB
testcase_16 AC 86 ms
76,168 KB
testcase_17 AC 85 ms
75,924 KB
testcase_18 AC 87 ms
76,092 KB
testcase_19 AC 86 ms
75,920 KB
testcase_20 AC 87 ms
76,112 KB
testcase_21 AC 87 ms
75,904 KB
testcase_22 AC 85 ms
75,908 KB
testcase_23 AC 85 ms
76,068 KB
testcase_24 AC 86 ms
76,088 KB
testcase_25 AC 87 ms
75,908 KB
testcase_26 AC 83 ms
76,236 KB
testcase_27 AC 85 ms
76,208 KB
testcase_28 AC 87 ms
76,244 KB
testcase_29 AC 85 ms
76,240 KB
testcase_30 AC 78 ms
71,224 KB
testcase_31 AC 78 ms
71,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7

def solve():
    n = int(input())
    A = list(map(int, input().split()))
    ans = A[0]
    for a in A[1:]:
        ans = a * ans + a + ans
        ans %= MOD
    print(ans)
    
for _ in range(int(input())):
    solve()
0