I'd use a priority_queue here rather than multimap.  Its a much more natural fit for what you are doing.  I'd probably create an AsList class as an encapsulation of a priority_queue and then just build that here and return it to the caller to avoid have to build the list twice.