My solution to 1729G, Cut Substrings R2100
Разница между en2 и en3, 112 символ(ов) изменены
Approach↵
==================↵
We will solve two parts separately. First lets find the min number of moves.<br>↵
Let `n` be the size of s and `m` be the size of t.↵
Minimum number of moves.↵
------------------↵
Let `ans[l][r]` denote minimum number of moves to delete all occurrence of t in `s[l]...s[r]`.<br>↵
1. if there is no index `j`, in `[l,r]` such that `j+m-1 < r` and `s[j...j+m-1] == t` then `ans[l][r] = 0`.<br>↵
2. else for all `j`'s described above `ans[l][r] = min(ans[l][r], ans[l][j-1] + 1 + ans[j+m][r])` <br>↵
The minimum number of moves are `ans[0][n-1]`.<br>

<br>↵
<br>↵
Number of ways to achieve those minimum number of ways.↵
------------------↵
### Observations↵
1. 

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en10 Английский _Shivom_ 2023-08-09 10:36:55 7 Tiny change: 'number of ways.\n------' -> 'number of moves.\n------'
en9 Английский _Shivom_ 2023-08-09 10:34:53 0 Tiny change: '[0]`.\n\n[Implementaion](https://' -> '[0]`.\n\n[**CODE**](https://' (published)
en8 Английский _Shivom_ 2023-08-09 10:34:34 21 Tiny change: '[0]`.\n\n[Implementaion](https://' -> '[0]`.\n\n[**CODE**](https://'
en7 Английский _Shivom_ 2023-08-09 10:33:54 75
en6 Английский _Shivom_ 2023-08-09 10:32:20 83
en5 Английский _Shivom_ 2023-08-09 10:30:46 421
en4 Английский _Shivom_ 2023-08-09 10:20:59 899
en3 Английский _Shivom_ 2023-08-09 09:54:54 112
en2 Английский _Shivom_ 2023-08-09 09:46:15 56
en1 Английский _Shivom_ 2023-08-09 09:45:02 563 Initial revision (saved to drafts)