Create 2003b.cpp

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