Vector of perfect squares upto n ^ 2
vector < int > perfectSquares = getPerfectSquares ( pow ( n , 2 ) ) ; int count = 0 ; for ( int a = 1 ; a <= n ; a ++ ) { int aSquare = pow ( a , 2 ) ; for ( int i = 0 ; i < perfectSquares . size ( ) ; i ++ ) { int cSquare = perfectSquares [ i ] ;