For this Question: Given a weighted undirected graph.Task is to find the shortest path from source vertex (vertex number 1) to all other vertices from 2 to n.Given 2 integers N and M. N represents the number of vertices in the graph. M represents the number of edges between any 2 vertices.
Then M lines follow, each line has 2 space separated integers  a, b  where a and b represents an edge from vertex a to vertex b and the weight of that edge = (a+b)%1000.

Constraints 
1<=N<=100000
1<=M<=1000000Print the shortest distances from the source vertex (vertex number 1) to all other vertices from 2 to n in separate line. Print "-1" in case the vertex can't be reached form the source vertex.Sample Input
4 5
1 2 
1 4 
4 2 
4 3 
2 3 
Sample Output
3
8
5
, I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;

#define pu push_back
#define fi first
#define se second
#define mp make_pair
#define int long long
#define pii pair<int,int>
#define mm (s+e)/2
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(int i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define sz 200000
vector<int> NEB[sz],wt[sz];
int dist[sz];
int vis[sz];
signed main()
{
	
		int n,m;
		cin>>n>>m;

		for(int i=0;i<m;i++)
		{
			int a,b;
			cin>>a>>b;
			int c=(a+b)%1000;
			NEB[a].pu(b);
			NEB[b].pu(a);
			wt[a].pu(c);
			wt[b].pu(c);
		}
	     for(int i=1;i<=n;i++)
	     {
	     	dist[i]=1000000000;
	     }
	    multiset<pii> ss;
	    ss.insert(mp(0,1));
        dist[1]=0;
	    while(ss.size()>0)
	    {
	    	pii xx=*ss.begin();
	    	
	    	int a=xx.se;
             ss.erase(ss.begin());
	    	if(vis[a]==1) continue;
	    	vis[a]=1;
	    	int ww=dist[a];

	    	for(int i=0;i<NEB[a].size();i++)
	    	{
	    		int x=NEB[a][i];
	    		int y=wt[a][i];
	    		if(dist[x]>dist[a]+y)
	    		{
	    			dist[x]=dist[a]+y;
	    			ss.insert(mp(dist[x],x));
	    		}
	    	}
	    }
	    for(int i=2;i<=n;i++)
	    {  if(dist[i]>=1000000000) cout<<-1<<"\n";
	    	else cout<<dist[i]<<"\n";
	    }

}, In this Programming Language: C++, Now tell me if this Code is compilable or not?