Use concurrent_hash_map for sequential as well; Only generate subproblems once.