Please either format your code or link to your submission - the forum software has mangled it and it won’t compile! ![]()
Edit:
One immediately obvious problem - your program’s output has to match the expected output exactly, and the output from this:
for(int i=0;i<v.size();i++)cout<<v[i]<<" ";cout<<endl;
is definitely not expected.