結果

問題 No.1682 Unfair Game
ユーザー ああいいああいい
提出日時 2022-04-27 06:06:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 475 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 71,548 KB
最終ジャッジ日時 2023-09-10 16:31:35
合計ジャッジ時間 3,341 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,372 KB
testcase_01 AC 72 ms
71,128 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 73 ms
71,388 KB
testcase_05 WA -
testcase_06 AC 71 ms
71,460 KB
testcase_07 AC 71 ms
71,376 KB
testcase_08 WA -
testcase_09 AC 73 ms
71,544 KB
testcase_10 WA -
testcase_11 AC 75 ms
71,128 KB
testcase_12 AC 72 ms
71,372 KB
testcase_13 AC 70 ms
71,308 KB
testcase_14 AC 70 ms
71,316 KB
testcase_15 AC 70 ms
71,356 KB
testcase_16 AC 73 ms
71,124 KB
testcase_17 AC 71 ms
71,276 KB
testcase_18 AC 72 ms
71,312 KB
testcase_19 WA -
testcase_20 AC 71 ms
71,308 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
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