Wrong answer problem TRUEDARE

Well the questions is : TRUEDARE and i have tried different solutions using maps and sets and both are giving wrong answers (Maps solution & Set Solution) so i thought to check out the successful submissions. eg random c++ solution
They were quite similar but on submission they too were giving wrong answers with the cpp compilers what may be the problem here?