Submission #995550

# Submission time Handle Problem Language Result Execution time Memory
995550 2024-06-09T10:37:41 Z Nurislam Crocodile's Underground City (IOI11_crocodile) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
//#define int long long
#define Mp make_pair
//#define double double long
typedef vector<int> vi;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef vector<pii> vii;
const int maxN = 1e6, inf = 1e9, mod = 1e9+7;
#include "crocodile.h"
#include "grader.cpp"
int travel_plan(int n, int m, int r[][2], int l[], int k, int p[])
{
	vii g[n];
	for(int i = 0; i < m; i++){
		g[r[i][0]].pb({r[i][1], l[i]});
		g[r[i][1]].pb({r[i][0], l[i]});
	}
	int dp[n][2];
	for(int i = 0; i < n; i++)dp[i][0] = dp[i][1] = inf;
	for(int i = 0; i < k; i++)dp[p[i]][0] = dp[p[i]][1] = 0;
	priority_queue<pii, vii, greater<pii>> q;
	for(int i = 0; i < k; i++)q.push({0, p[i]});
	while(!q.empty()){
		auto [dis, x] = q.top();
		q.pop();
		if(dis > dp[x][0])continue;
		for(auto [to, ct]:g[x]){
			if(dp[to][1] > dp[x][1] + ct){
				dp[to][1] = dp[x][1] + ct;
				if(dp[to][1] < dp[to][0])swap(dp[to][1], dp[to][0]);
				q.push({dp[x][1]+ct, to});
			}
		}
	}
	//for(int i = 0; i < n; i++)cout << dp[i][0] << ' ' << dp[i][1] << '\n';
	
	return dp[0][1];
}









Compilation message

/usr/bin/ld: /tmp/cc3X0cud.o: in function `read_input()':
grader.cpp:(.text+0x0): multiple definition of `read_input()'; /tmp/ccAbeghd.o:crocodile.cpp:(.text+0x90): first defined here
/usr/bin/ld: /tmp/cc3X0cud.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccAbeghd.o:crocodile.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status