The version of C++ code here differs from the first one been posted at Lxer.com . Vector “v1” been pushed back by 2D vector “vec” is supposed to be re-declared before every next push back by “vec” versus option of been cleaned up in previous version of compilation.
Source: LXer – C++ versus Python solving one problem from the field of number theory