結果
| 問題 | No.1702 count good string |
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2024-08-08 20:17:57 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 86 ms / 2,000 ms |
| + 687µs | |
| コード長 | 324 bytes |
| 記録 | |
| コンパイル時間 | 235 ms |
| コンパイル使用メモリ | 96,108 KB |
| 実行使用メモリ | 84,480 KB |
| 最終ジャッジ日時 | 2026-08-24 21:51:35 |
| 合計ジャッジ時間 | 6,175 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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