結果

問題 No.1702 count good string
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-10-08 22:38:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 454 bytes
コンパイル時間 1,051 ms
コンパイル使用メモリ 86,524 KB
実行使用メモリ 171,416 KB
最終ジャッジ日時 2023-09-30 11:36:25
合計ジャッジ時間 14,649 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,112 KB
testcase_01 AC 74 ms
70,760 KB
testcase_02 AC 84 ms
75,564 KB
testcase_03 AC 80 ms
75,516 KB
testcase_04 AC 82 ms
75,392 KB
testcase_05 AC 81 ms
75,852 KB
testcase_06 AC 81 ms
75,532 KB
testcase_07 AC 80 ms
75,512 KB
testcase_08 AC 80 ms
75,384 KB
testcase_09 AC 83 ms
75,408 KB
testcase_10 AC 83 ms
75,416 KB
testcase_11 AC 83 ms
75,500 KB
testcase_12 AC 79 ms
75,616 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 86 ms
75,752 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 86 ms
75,692 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 74 ms
71,168 KB
testcase_46 AC 75 ms
71,036 KB
testcase_47 AC 75 ms
70,632 KB
testcase_48 AC 78 ms
70,944 KB
testcase_49 AC 75 ms
70,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a = list(" yukicoder")
aa = list(" yukicoder")
n = int(input())
s = list(input())
ans = 0
for i in range(10):
    dp = [[0] * (n+1)] +  [[0] * (n+1) for _ in range(9)]
    dp[0][0] = 1
    for j in range(10):
        for k in range(1,n+ 1):
            dp[j][k] += dp[j][k-1]
            if s[k-1] == a[j]:
                dp[j][k] += dp[j-1][k-1]
    ans += dp[-1][-1]
    if i == 9:break
    a[i+1] = "?"
    a[i] = aa[i]
#     print(dp[-1])
print(ans)
0