Implementation of Dijkstra's Algorithm using set data structure in C++

I was trying to implement Dijkstra using set data structure in C++. I was coding in C++14 and there seems to be something out of order in the code for it is not giving me the right answer in Codechef IDE and on DevCpp it is not even compiling!

I believe the code is logically sound and there are only semantic errors in it.

Implementing Dijkstra using set in C++

Ignore this I have figured it out. (BTW, the code works. And is logically sound feel free to use it if needed.)