結果

問題 No.1336 Union on Blackboard
ユーザー ygd.ygd.
提出日時 2021-01-15 21:33:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 763 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 76,872 KB
最終ジャッジ日時 2023-08-17 16:14:28
合計ジャッジ時間 4,492 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,392 KB
testcase_01 AC 84 ms
76,784 KB
testcase_02 AC 82 ms
76,488 KB
testcase_03 AC 82 ms
76,820 KB
testcase_04 AC 82 ms
76,832 KB
testcase_05 AC 83 ms
76,604 KB
testcase_06 AC 85 ms
76,592 KB
testcase_07 AC 83 ms
76,588 KB
testcase_08 AC 83 ms
76,824 KB
testcase_09 AC 82 ms
76,872 KB
testcase_10 AC 82 ms
76,640 KB
testcase_11 AC 83 ms
76,596 KB
testcase_12 AC 81 ms
76,592 KB
testcase_13 AC 83 ms
76,572 KB
testcase_14 AC 82 ms
76,520 KB
testcase_15 AC 82 ms
76,820 KB
testcase_16 AC 87 ms
76,648 KB
testcase_17 AC 83 ms
76,488 KB
testcase_18 AC 84 ms
76,748 KB
testcase_19 AC 81 ms
76,692 KB
testcase_20 AC 83 ms
76,464 KB
testcase_21 AC 82 ms
76,756 KB
testcase_22 AC 83 ms
76,800 KB
testcase_23 AC 83 ms
76,632 KB
testcase_24 AC 82 ms
76,848 KB
testcase_25 AC 83 ms
76,700 KB
testcase_26 AC 81 ms
76,692 KB
testcase_27 AC 83 ms
76,796 KB
testcase_28 AC 83 ms
76,496 KB
testcase_29 AC 83 ms
76,800 KB
testcase_30 AC 72 ms
71,312 KB
testcase_31 AC 73 ms
71,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Case = int(input()); MOD = pow(10,9) + 7
for _ in range(Case):
    N = int(input())
    A = list(map(int,input().split()))
    while len(A) > 1:
        a = A.pop()
        b = A.pop()
        c = a + b + a*b
        c %= MOD
        A.append(c)
        #print(A)
    print(A[0]%MOD)
0