set <pair <int, int>> q;
应为
set <pair <long long, int>> q;
int dist[N];
long long dist[N];
printf("ARK\n");
。。。 3. 二分
if (dijkstra(M) < k)
如果血量为负就四了