結果

問題 No.1681 +-*
ユーザー shinichishinichi
提出日時 2021-09-22 18:39:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 243 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 100,616 KB
最終ジャッジ日時 2023-09-18 19:41:17
合計ジャッジ時間 5,620 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,460 KB
testcase_01 AC 72 ms
71,272 KB
testcase_02 AC 75 ms
71,280 KB
testcase_03 AC 75 ms
71,188 KB
testcase_04 AC 73 ms
71,156 KB
testcase_05 AC 182 ms
92,176 KB
testcase_06 AC 183 ms
92,232 KB
testcase_07 AC 181 ms
92,052 KB
testcase_08 WA -
testcase_09 AC 199 ms
100,316 KB
testcase_10 AC 199 ms
100,616 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 129 ms
85,208 KB
testcase_14 AC 198 ms
100,224 KB
testcase_15 AC 71 ms
71,320 KB
testcase_16 AC 71 ms
71,192 KB
testcase_17 AC 202 ms
100,396 KB
testcase_18 AC 199 ms
100,608 KB
testcase_19 AC 199 ms
99,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
mod = 10**9+7
ans = 0
now = 1
for i, a in enumerate(map(int, input().split())):
    now *= a
    now %= mod
    if i == N-1:
        ans += now
        continue
    ans += now * pow(3, N-i-2, mod) * 2
    ans %= mod
print(ans)
0