後者だったらstd::multimapでよくね
unorderedでもいいけど