[BZOJ] [81] [Coci2015] [Divljak] [solution] [AC automatic mechanism], bzoj1_81
Door: http://www.lydsy.com/JudgeOnline/problem.php? Id = 3881
Thank you for your reminder.
Create an AC automatic machine for S and record the End Node of each string
Insert is to run it again on the fail tree, and put the node ans ++ that has not been accessed this time
Ask O (1)
If the link is attached to each vertex, the link will not be dropped.
Consider that all S are,
Then I have 10 ^ 5 inserts
Scan the chain once inserted, n ^ 2 ......
UPD:
Laruence says my approach is not complex ......
It's time to get a constant card.
Correct posture
UPD:
I found myself making a silly mistake and ran for more than 15 s.
After the change, rank1 was temporarily refreshed.
UPD:
Luye took me out.
Roll back to the classroom, study late, rewrite tomorrow
Remove my data (lu ye provides the idea TImeMachine for data,Not added to bzoj)
In the same way, lu ye only used 1 s +, and I used 10 s + ...... (Standard Process <1 s)
What is this? =,
Code:
No code posted