結果

問題 No.1682 Unfair Game
ユーザー KudeKude
提出日時 2021-09-17 21:53:55
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 870 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 71,708 KB
最終ジャッジ日時 2023-09-12 07:22:37
合計ジャッジ時間 2,899 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,424 KB
testcase_01 AC 71 ms
71,468 KB
testcase_02 AC 71 ms
71,344 KB
testcase_03 AC 71 ms
71,596 KB
testcase_04 AC 71 ms
71,420 KB
testcase_05 AC 70 ms
71,708 KB
testcase_06 AC 69 ms
71,400 KB
testcase_07 AC 70 ms
71,488 KB
testcase_08 AC 70 ms
71,632 KB
testcase_09 AC 72 ms
71,392 KB
testcase_10 AC 72 ms
71,276 KB
testcase_11 AC 70 ms
71,304 KB
testcase_12 AC 71 ms
71,200 KB
testcase_13 AC 72 ms
71,532 KB
testcase_14 AC 71 ms
71,332 KB
testcase_15 AC 71 ms
71,468 KB
testcase_16 AC 72 ms
71,296 KB
testcase_17 AC 72 ms
71,464 KB
testcase_18 AC 73 ms
71,584 KB
testcase_19 AC 72 ms
71,416 KB
testcase_20 AC 72 ms
71,528 KB
testcase_21 AC 72 ms
71,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
n = int(input())
dp0 = 1
dp1 = 0
for p in map(int, input().split()):
    ndp0 = dp0
    ndp1 = dp1
    if p < 50:
        ndp0 += dp0
        ndp1 += dp1
    elif p > 50:
        ndp0 += dp1
        ndp1 += dp0
    dp0, dp1 = ndp0, ndp1
    dp0 %= MOD
    dp1 %= MOD

ans = dp1 % MOD
print(ans)
0