結果
問題 | No.1681 +-* |
ユーザー | 👑 SPD_9X2 |
提出日時 | 2021-09-17 21:42:10 |
言語 | PyPy3 (7.3.13) |
結果 |
TLE
|
実行時間 | - |
コード長 | 357 bytes |
コンパイル時間 | 300 ms |
コンパイル使用メモリ | 87,056 KB |
実行使用メモリ | 109,064 KB |
最終ジャッジ日時 | 2023-09-12 07:07:56 |
合計ジャッジ時間 | 4,628 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 72 ms
71,440 KB |
testcase_01 | AC | 77 ms
71,380 KB |
testcase_02 | AC | 76 ms
71,352 KB |
testcase_03 | AC | 75 ms
71,416 KB |
testcase_04 | AC | 74 ms
71,380 KB |
testcase_05 | TLE | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
ソースコード
""" 最初の掛け算の項以外は、対消滅する """ import sys from sys import stdin mod = 10**9+7 N = int(stdin.readline()) A = list(map(int,stdin.readline().split())) ans = 0 now = 1 for i in range(N): now *= A[i] now %= mod if i == N-1: ans += now else: ans += now * 2 * pow(3,N-2-i) print (ans % mod)