One of the most positive things in codeforces is that we can see different approaches to solutions to the same problem.
For example to the problem 246D of today.
Approaches:
Suffix Automaton — 6626607
String Hashes — 6625476
Suffix Array — 6630083
Z-Algorithm — 6624439
KMP — 6627491
and many others, just we need find them. You have find another?
Nothing to say)
There is also suffix tree solution 6651814
I have a solution that uses suffix array + LCP pre computation + hashing + two pointers. Got WA at test 29, because I used
unsigned long long
in the hashing part to avoid modulo. Never gonna make the same mistake :) Here is the corrected code: http://codeforces.me/contest/432/submission/6632179