Reducing memory usage of nested vectors
Since your overall number of indices just fits into 31 bits, you could try a std::map:

uint32_t keyFrom5DIndex(uint32_t a, uint32_t b, 
                        uint32_t x, uint32_t y, uint32_t z)
{
    return z+24000*(x+30*(y+30*(b+10*a)));
}

std::map&lt;uint32_t, float&gt; votes;
// Compute indices
votes[keyFrom5DIndex(a,b,z,y,z)] += this_vote;