結果

問題 No.1702 count good string
ユーザー ntuda
提出日時 2025-06-04 20:15:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 273 bytes
コンパイル時間 690 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 76,288 KB
最終ジャッジ日時 2025-06-04 20:16:03
合計ジャッジ時間 5,667 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 47
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
dp = [1] + [0] * 9
dic = dict(zip("yukicoder",range(1,N+1)))
print(dp)
for s in S:
    if s in dic:
        a = dic[s]
        dp[a] += dp[a-1]
    if s  == "?":
        for i in reversed(range(1,10)):
            dp[i] += dp[i-1]
print(dp[-1])
0