Create 2003a.cpp

AC solution: O(N sqrt(MAXN) log(MAXN)) time; O(MAXN) memory