Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
普通的自动机能过……RT…… p是pattern,now是输入字符串,1300MS通过…… bool go(char now[],char p[]) { if (p[0]=='*' && p[1]==0) return 1; if (now[0]==0 || p[0]==0) { if (now[0]==0 && p[0]==0) return 1; return 0; } if (p[0]=='?'|| p[0]==now[0]) return go(now+1,p+1); if (p[0]=='*') { for (char *i=now;;i++) { if (go(i,p+1)) return 1; if (*i==0) return 0; } return 0; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator