Submission #981172

# Submission time Handle Problem Language Result Execution time Memory
981172 2024-05-13T01:11:17 Z Lib Swapping Cities (APIO20_swap) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
int n,m;
vector <vector <int> > InComponents;
vector <int> TVector;
struct Edge{
	long long Weight;
	int Start;
	int End;
};
bool operator< (const edge &x, const edge &y){
	return x.Weight<y.Weight;
}
Edge Elist[500003];
int Depth[500003];
void init(int N, int M, vector <int> U, vector <int> V, vector <int> W){
	n=N;
	m=M;
	for(int i=0;i<n+m+5;i++){
		InComponents.push_back(TVector);
	}
	for(int i=0;i<m;i++){
		Elist[i].Weight=W[i];
		Elist[i].Start=U[i];
		Elist[i].End=V[i];
	}
}

int getMinimumFuelCapacity(int x, int y){
	return 1;
}

Compilation message

swap.cpp:11:23: error: 'edge' does not name a type; did you mean 'Edge'?
   11 | bool operator< (const edge &x, const edge &y){
      |                       ^~~~
      |                       Edge
swap.cpp:11:38: error: 'edge' does not name a type; did you mean 'Edge'?
   11 | bool operator< (const edge &x, const edge &y){
      |                                      ^~~~
      |                                      Edge
swap.cpp:11:6: error: 'bool operator<(const int&, const int&)' must have an argument of class or enumerated type
   11 | bool operator< (const edge &x, const edge &y){
      |      ^~~~~~~~