Despite the fact that you're calling that variable SET, it is not a set. It's a list. The appropriate C++ container would be std::vector<> not std::set<>.

(Python "lists" are actually arrays.)
...