답안 #405915

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
405915 2021-05-17T03:56:54 Z Maqsut_03 자매 도시 (APIO20_swap) C++14
컴파일 오류
0 ms 0 KB
#include "swap.h"
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<deque>

#define ll long long 
#define pl pair<ll, ll> 
#define llv vector<ll>
#define pb push_back
#define ppb(x, y) push_back({x, y})

using namespace std;
const int N = 2 * 1e5 + 3;

int n, m, a = 0, b = 0;
pv v[N];
bool q = 1;

void init(int N, int M, vector<int> U, vector<int> V, vector<int> W) 
{
    n = N;
    m = M;
    for (int i=0; i<m; i++) 
	{
    	v[V[i]].ppb(U[i], W[i]);
    	v[U[i]].ppb(V[i], W[i]);
	}
	for (int i=0; i<n; i++) 
	{
		if (v[i].sz == 2) a++;
		if (v[i].sz == 1) b++;
	}
	if (b == 2 && a + b == n) q = 0;
    return ;
}

int getMinimumFuelCapacity(int X, int Y) 
{
	if (q)
	{
		return 1;
	}
	else return -1;
	
}

Compilation message

swap.cpp:20:1: error: 'pv' does not name a type; did you mean 'pb'?
   20 | pv v[N];
      | ^~
      | pb
swap.cpp: In function 'void init(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
swap.cpp:29:6: error: 'v' was not declared in this scope
   29 |      v[V[i]].ppb(U[i], W[i]);
      |      ^
swap.cpp:34:7: error: 'v' was not declared in this scope
   34 |   if (v[i].sz == 2) a++;
      |       ^
swap.cpp:35:7: error: 'v' was not declared in this scope
   35 |   if (v[i].sz == 1) b++;
      |       ^