結果

問題 No.457 (^^*)
ユーザー h_noson
提出日時 2017-01-26 17:57:45
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 449 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-23 11:43:19
合計ジャッジ時間 2,153 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

s = ["(^^*)","(*^^)"]
dp = [[0] * 6 for i in range(2)]
dp[0][0] = dp[1][0] = 1
for c in input():
    for i in range(2):
        for j in range(5)[::-1]:
            if s[i][j] == c:
                dp[i][j+1] += dp[i][j]
                if j != 0 and j != 4: dp[i][j] = 0
print(dp[0][5],dp[1][5])
0