1002 AC

Two AC source code , one is more readable, and the other one is faster
and smaller.