Submission #207570

# Submission time Handle Problem Language Result Execution time Memory
207570 2020-03-08T04:38:37 Z aloo123 Crocodile's Underground City (IOI11_crocodile) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
 #include <crocodile.h>
#define int long long
using namespace std;
#define pii pair<int,int>
const int INF = 10000000000000000;
int travel_plan(int n,int m,int r[][2],int l[],int k,int p[]){
	vector<pii> adj[n];
	for(int i =0;i<m;i++){
		int u = r[i][0];
		int v = r[i][1];
		int d = l[i];
		adj[u].push_back(make_pair(u,d));
		adj[v].push_back(make_pair(v,d));
	}
	pii dis[n];
	for(int i =0;i<n;i++) dis[i] = mp(INF,INF);
	priority_queue<pii,vector<pii>,greater<pii>> pq;
	for(int i =0;i<k;i++){
		ll u = p[i];
		pq.push(mp(0,u));
		dis[u].f = 0;
		dis[u].s = 0;
	}

	while(!pq.empty()){
		pii u = pq.front();
		pq.pop();
		for(auto v:adj[u]){
			int vertex = v.s;
			if(dis[vertex].f > dis[u.s].f + v.f){
				dis[vertex].s = dis[vertex].f;
				dis[vertex].f = dis[u.s].f + v.f;
				pq.push(mp(dis[vertex.f,vertex]));
			}
		}
	}

	return dis[0].s;

}

Compilation message

crocodile.cpp: In function 'long long int travel_plan(long long int, long long int, long long int (*)[2], long long int*, long long int, long long int*)':
crocodile.cpp:17:33: error: 'mp' was not declared in this scope
  for(int i =0;i<n;i++) dis[i] = mp(INF,INF);
                                 ^~
crocodile.cpp:17:33: note: suggested alternative: 'm'
  for(int i =0;i<n;i++) dis[i] = mp(INF,INF);
                                 ^~
                                 m
crocodile.cpp:20:3: error: 'll' was not declared in this scope
   ll u = p[i];
   ^~
crocodile.cpp:20:3: note: suggested alternative: 'l'
   ll u = p[i];
   ^~
   l
crocodile.cpp:21:16: error: 'u' was not declared in this scope
   pq.push(mp(0,u));
                ^
crocodile.cpp:21:11: error: 'mp' was not declared in this scope
   pq.push(mp(0,u));
           ^~
crocodile.cpp:21:11: note: suggested alternative: 'm'
   pq.push(mp(0,u));
           ^~
           m
crocodile.cpp:27:14: error: 'class std::priority_queue<std::pair<long long int, long long int>, std::vector<std::pair<long long int, long long int> >, std::greater<std::pair<long long int, long long int> > >' has no member named 'front'
   pii u = pq.front();
              ^~~~~
crocodile.cpp:29:17: error: no match for 'operator[]' (operand types are 'std::vector<std::pair<long long int, long long int> > [n]' and 'std::pair<long long int, long long int>')
   for(auto v:adj[u]){
                 ^
crocodile.cpp:31:19: error: 'struct std::pair<long long int, long long int>' has no member named 'f'
    if(dis[vertex].f > dis[u.s].f + v.f){
                   ^
crocodile.cpp:31:29: error: 'struct std::pair<long long int, long long int>' has no member named 's'
    if(dis[vertex].f > dis[u.s].f + v.f){
                             ^
crocodile.cpp:32:17: error: 'struct std::pair<long long int, long long int>' has no member named 's'
     dis[vertex].s = dis[vertex].f;
                 ^
crocodile.cpp:32:33: error: 'struct std::pair<long long int, long long int>' has no member named 'f'
     dis[vertex].s = dis[vertex].f;
                                 ^
crocodile.cpp:33:17: error: 'struct std::pair<long long int, long long int>' has no member named 'f'
     dis[vertex].f = dis[u.s].f + v.f;
                 ^
crocodile.cpp:33:27: error: 'struct std::pair<long long int, long long int>' has no member named 's'
     dis[vertex].f = dis[u.s].f + v.f;
                           ^
crocodile.cpp:34:27: error: request for member 'f' in 'vertex', which is of non-class type 'long long int'
     pq.push(mp(dis[vertex.f,vertex]));
                           ^
crocodile.cpp:34:13: error: 'mp' was not declared in this scope
     pq.push(mp(dis[vertex.f,vertex]));
             ^~
crocodile.cpp:34:13: note: suggested alternative: 'm'
     pq.push(mp(dis[vertex.f,vertex]));
             ^~
             m
crocodile.cpp:39:16: error: 'struct std::pair<long long int, long long int>' has no member named 's'
  return dis[0].s;
                ^