I'll show you fill(v.begin(), v.end(), value) to set all elements in a range to a specific value. This is faster and cleaner than writing a loop that assigns each element. You can fill part of a vector: fill(v.begin(), v.begin() + 10, -1) sets the first ten elements to -1 while leaving the rest of the vector unchanged.
For multidimensional arrays, you'll need nested calls or use memset for simple types. Time complexity is since it assigns each element in the specified range.