Submission #109136

# Submission time Handle Problem Language Result Execution time Memory
109136 2019-05-04T16:31:53 Z pamaj Crocodile's Underground City (IOI11_crocodile) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "crocodile.h"
using namespace std;
const int maxn = 1e5 + 10;

typedef pair<int, int> pii;

int vis[maxn], dist[maxn];
vector<pii> G[maxn]

int travel_plan(int N, int M, int R[][2], int L[], int K, int P[])
{
	memset(dist, 0x3f3f3f3f3f, sizeof(dist));

	for(int i = 0; i < M; i++)
	{
		int a = R[i][0], b = R[i][1];

		G[a].push_back({L[i], b});
		G[b].push_back({L[i], a});
	}

	priority_queue<pii, vector<pii>, greater<pii>> q;

	for(int i = 0; i < k; i++)
	{
		dist[p[i]] = 0;

		q.push({0, p[i]});
	}

	while(!q.empty())
	{
		auto a = q.top();
		q.pop();

		if(vis[a.second] == 0)
		{
			vis[a.second]++;
			continue;
		}
		else if(vis[a.second] == 2)
		{
			continue;
		}
		vis[a.second]++;

		for(auto u : G[a.second])
		{
			if(dist[u.second] > dist[a.second] + u.first)
			{
				dist[u.second] = dist[a.second] + u.first;
				q.push({dist[u.second], u.second});
			}
		}
	}

	return dist[0];
}

Compilation message

crocodile.cpp:11:1: error: expected initializer before 'int'
 int travel_plan(int N, int M, int R[][2], int L[], int K, int P[])
 ^~~