結果
問題 | No.1681 +-* |
ユーザー | Mik10 |
提出日時 | 2021-10-07 20:58:56 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 268 bytes |
コンパイル時間 | 1,952 ms |
コンパイル使用メモリ | 86,544 KB |
実行使用メモリ | 263,872 KB |
最終ジャッジ日時 | 2023-09-30 09:04:53 |
合計ジャッジ時間 | 5,500 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 81 ms
71,440 KB |
testcase_01 | AC | 80 ms
71,220 KB |
testcase_02 | AC | 80 ms
71,432 KB |
testcase_03 | AC | 81 ms
71,444 KB |
testcase_04 | AC | 81 ms
71,480 KB |
testcase_05 | AC | 120 ms
104,848 KB |
testcase_06 | AC | 116 ms
104,920 KB |
testcase_07 | AC | 125 ms
105,388 KB |
testcase_08 | TLE | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
ソースコード
n = int(input()) seql = list(map(int, input().split())) import operator, itertools n -= 2 ans = 0 for p in itertools.accumulate(seql, func=operator.mul): if not p: break ans += pow(3, n, 10**9+7) * 2*p if n >= 0 else p n -= 1 print (ans%(10**9+7))