Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:求助wa,老衲过掉了网上能找到的所有数据,并且和很多人的AC代码对拍掉了很多数据,

Posted by lzqxh at 2012-02-16 22:34:26 on Problem 2778
In Reply To:求助wa,老衲过掉了网上能找到的所有数据,并且和很多人的AC代码对拍掉了很多数据, Posted by:qq605007 at 2011-12-30 17:35:16
如果我到狗眼还没瞎到话你这里应该写错了
    while (fi<=la)
    {
        u=que[fi++];
        if (u->count)continue;
        for (key=0;key<tot;key++)
            if (v=u->son[key])
            {
                ans[u->id][v->id]++;
                if (!vis[v->id])que[++la]=v,vis[v->id]=true;
            } else ans[u->id][root->id]++;
    }
不存在key儿子到话 。应该顺着fail指针走到下一个它可能出现的位置。。而不是root

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator