Submission #977604

# Submission time Handle Problem Language Result Execution time Memory
977604 2024-05-08T07:30:12 Z Ning07 Swapping Cities (APIO20_swap) C++17
Compilation error
0 ms 0 KB
#include "swap.h"

#include <vector>
#include<bits/stdc++.h>
using namespace std;

#define L(i, j, k) for (int i = (j); i <= k; i++) 
#define R(i, j, k) for (int i = (j); i >= k; i--) 

const int nax = 100050;
int N, M;
int ok = true;
int mx = -1;
ector<pair<int, int>> G[nax];

void init(int _N, int _M, std::vector<int> _U, std::vector<int> _V, std::vector<int> _W) {
    N = _N; M = _M;
    for (int i = 0; i < M; i++) {
        G[_U[i]].push_back(make_pair(_V[i], _W[i]));
        G[_V[i]].push_back(make_pair(_U[i], _W[i]));
        mx = max(mx, _W[i]);
    }
    for (int i = 0; i < N; i++) 
        if (adj[i].size() <= 1) 
            ok = false;
}

int getMinimumFuelCapacity(int X, int Y) {
    if (!ok) return -1;
    return mx;
}

Compilation message

swap.cpp:14:1: error: 'ector' does not name a type
   14 | ector<pair<int, int>> G[nax];
      | ^~~~~
swap.cpp: In function 'void init(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
swap.cpp:19:9: error: 'G' was not declared in this scope
   19 |         G[_U[i]].push_back(make_pair(_V[i], _W[i]));
      |         ^
swap.cpp:24:13: error: 'adj' was not declared in this scope
   24 |         if (adj[i].size() <= 1)
      |             ^~~