結果
問題 |
No.1702 count good string
|
ユーザー |
![]() |
提出日時 | 2021-10-09 05:22:42 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 446 bytes |
コンパイル時間 | 158 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-07-23 15:54:25 |
合計ジャッジ時間 | 13,409 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 39 |
ソースコード
N=int(input()) S=input().strip() mod=10**9+7 DP0=[0]*9 DP1=[0]*9 yukicoder="yukicoder" for s in S: for j in range(9): if s==yukicoder[j]: if j==0: DP0[0]+=1 else: DP0[j]+=DP0[j-1] DP1[j]+=DP1[j-1] if s=="?": for j in range(1,9): DP1[j]+=DP0[j-1] for j in range(9): DP0[j]%=mod DP1[j]%=mod print(DP0[-1]+DP1[-1])