+1
同问最后一点为何RE
```cpp
#include <iostream>
#include <cstring>
using namespace std;
int t,w=1;
string a,b,aa[1100],bb[1100];
struct note{
string s;
int ti;
}d[7000010];
int main()
{
cin>>a>>b;
//if (a=="abaaaba"&&b=="abcdaba"){cout<<8<<endl;return 0;}
int cc=0;
while (cin>>aa[cc]>>bb[cc])cc++;
d[1].s=a;d[1].ti=0;
int i;
string::size_type j;
while (t<w)
{
t++;
if (d[t].ti>10)continue;
for (i=0;i<cc;i++)
for (j=d[t].s.find(aa[i]);j<d[t].s.size();j=d[t].s.find(aa[i],j+1))
{
w++;
d[w].s=d[t].s;
d[w].s.replace(j,aa[i].size(),bb[i]);
d[w].ti=d[t].ti+1;
if (d[w].ti<=10&&d[w].s==b){cout<<d[w].ti<<endl;return 0;}
}
}
cout<<"NO ANSWER!"<<endl;
return 0;
}
```
by a___ @ 2017-06-10 16:05:40
你们是:
,
/ \
{ }
p !
; : ;
| : |
| : |
```cpp
l ; l
l ; l
I ; I
I ; I
I ; I
I ; I
```
d | b
H | H
H | H
H I H
```cpp
,;, H I H ,;,
;H@H; ;_H_;, ;H@H;
`\Y/d_,;|4H@HK|;,_b\Y/'
'\;MMMMM$@@@$MMMMM;/'
"~~~*;!8@8!;*~~~"
;888;
;888;
;888;
;888;
```
d8@8b
O8@8O
T808T
`~`
by lixicheng @ 2017-07-07 22:26:11
?
by ZJsheep @ 2017-07-13 21:27:57