Language: C++

#include<iostream>
using namespace std;
#include<vector>

#define infinity 9999999
#define V 100000
#define C 10000
#define E 500000

struct edge
{
    int t;  //target vertices of i-th edge
    int d;  //the cost of the i-th edge
    int next; //The next edge of the same starting point
};
int count,min,k;//min represents the min cost of the point to the source point in the set of P
			//k records this point
int v,e,r;  //e represents the number of edges
     //v represents the number of vertices
	 //r represents the source of the graph
vector<int> head;  //The location of the edge corresponding to the node in the storage array
vector<edge> edges;  //information of edge

void add_edge(int s,int t,int d);

int main()
{
	while(1)
	{
		cout<<"Please input the number of the points and edges and the source of the map in order:"<<endl;
		cin>>v>>e>>r;
		if(v<1||v>V||e<0||e>E||r>=v)
		{
			cout<<"The input value is out of range!"<<endl;
			cin.clear();
		}
		else 
			break;
	}
	int i,j;
	vector<int> dis(v,infinity);  //the cost of the shortest path from the source to each vertex	
	vector<bool> flag(v,false);  //whether the point is in the set of shortest points away from the source,S for yes,P for no
	head.resize(v,-1);
	edges.resize(e);
	for(i=0;i<e;i++) //initialize edges
		edges[i].next=-1;

	int point1,point2,cost;
	i=1;
	while(1)
	{
		for(;i<=e;i++)
		{
			cout<<"Please input the origin point and terminal point of edge["<<i<<"] and its value in order:"<<endl;
			cin>>point1>>point2>>cost;
			if(point1<0||point1>C||point2<0||point2>C)
			{
				cout<<"Please enter a number between 1 and "<<C<<"!"<<endl;
				cin.clear();
				break;
			}
			add_edge(point1,point2,cost);
		}
		if(i>e)
			break;
	}

	dis[r]=0;
	for(j=head[r];j>=0;j=edges[j].next)//initialize the cost of the shortest path
		dis[edges[j].t]=edges[j].d;
    
	flag[r]=1;
    for(i=1;i<v;i++)//There is no comparison between the source and the source point, so the total number of times is less  
    {
        min=infinity;
        k=0;
        for(j=0;j<v;j++)
			if(!flag[j]&&min>dis[j])//The points from the source are compared in turn to get the min cost in P
			{
				min=dis[j];
				k=j;
			}
        flag[k]=1;
        for(j=head[k];j>=0;j=edges[j].next)	//Find the min cost point from the source point 
										//and start updating the value of the source point to each point in the dis 
			if(!flag[edges[j].t]&&dis[edges[j].t]>dis[k]+edges[j].d)
				dis[edges[j].t]=dis[k]+edges[j].d;
    }
	for (i=0;i<v;i++)  //output dis
    {  
		if(dis[i]<infinity)
			cout<<dis[i]<<endl; 
		else
			cout<<"INF"<<endl;
    }    
    return 0;
}

void add_edge(int s,int t,int d) //add information of edge
{    
    edges[count].t=t;
    edges[count].d=d;
    edges[count].next=head[s];
    head[s]=count;
	count++;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:9: error: reference to 'min' is ambiguous
   75 |         min=infinity;
      |         ^~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:16:11: note:                 'int min'
   16 | int count,min,k;//min represents the min cost of the point to the source point in the set of P
      |           ^~~
a.cc:78:38: error: reference to 'min' is ambiguous
   78 |                         if(!flag[j]&&min>dis[j])//The points from the source are compared in turn to get the min cost in P
      |                                      ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:16:11: note:                 'int min'
   16 | int count,min,k;//min represents the min cost of the point to the source point in the set of P
      |           ^~~
a.cc:80:33: error: reference to 'min' is ambiguous
   80 |                                 min=dis[j];
      |                                 ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:16:11: note:                 'int min'
   16 | int count,min,k;//min represents the min cost of the point to the source point in the set of P
      |           ^~~