結果

問題 No.1682 Unfair Game
ユーザー ああいいああいい
提出日時 2022-04-27 08:39:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 588 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 71,664 KB
最終ジャッジ日時 2023-09-10 16:31:45
合計ジャッジ時間 2,869 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 70 ms
71,236 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 71 ms
71,324 KB
testcase_08 WA -
testcase_09 AC 69 ms
71,572 KB
testcase_10 WA -
testcase_11 AC 72 ms
71,336 KB
testcase_12 AC 71 ms
71,280 KB
testcase_13 WA -
testcase_14 AC 71 ms
71,272 KB
testcase_15 AC 72 ms
71,508 KB
testcase_16 WA -
testcase_17 AC 71 ms
71,332 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 70 ms
71,280 KB
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
P = list(map(int,input().split()))
dp = [[0] * 2 for _ in range(N + 1)]
mod = 10 ** 9 + 7
dp[0][0] = 1

import sys
l = []
for p in P:
    if p != 50:
        l.append(p)
N = len(l)
dp = [[0] * 2 for _ in range(N+1)]
for i in range(1,N+1):
    if P[i-1] > 50:
        dp[i][1] = dp[i-1][0] + dp[i-1][1]
        dp[i][0] = dp[i-1][1] + dp[i-1][0]
    elif P[i-1] == 50:
        dp[i][0] = dp[i-1][0] * 2
        dp[i][1] = dp[i-1][1] * 2
    else:
        dp[i][1] = dp[i-1][1] * 2
        dp[i][0] = dp[i-1][0] * 2
    dp[i][0] %= mod
    dp[i][1] %= mod
print(dp[-1][1])
0