結果
| 問題 | No.1702 count good string |
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2024-08-08 20:17:57 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 324 bytes |
| 記録 | |
| コンパイル時間 | 403 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 81,152 KB |
| 最終ジャッジ日時 | 2026-04-03 20:16:40 |
| 合計ジャッジ時間 | 3,544 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge5_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 47 |
ソースコード
n=int(input())
s=input()
t="yukicoder"
m=len(t)
M=10**9+7
q=[[0]*(m+1),[0]*(m+1)]
q[0][0]=1
for c in s:
for i in reversed(range(m)):
if c==t[i]:
q[0][i+1]+=q[0][i]
q[0][i+1]%=M
q[1][i+1]+=q[1][i]
q[1][i+1]%=M
if c=="?":
q[1][i+1]+=q[0][i]
q[1][i+1]%=M
print((q[0][m]+q[1][m])%M)
sasa8uyauya