답안 #817783

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
817783 2023-08-09T16:13:14 Z OrazB 슈퍼트리 잇기 (IOI20_supertrees) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "supertrees.h"
using namespace std;
#define all(x) (x).begin(), (x).end()
#define ll long long int
#define pii pair <int, int>
#define pb push_back
#define ff first
#define ss second

const int N = 1e5+5;
int tp[N];

int construct(vector<vector<int>> p){
	vector<vector<int>> b(n, vector<int>(n));
	int n = p.size();
	for (int i = 0; i < n; i++){
		if (tp[i]){
			if (p[tp[i]] != p[i]) return 0;
			continue;
		}
		for (int j = 0; j < n; j++){
			if (p[i][j]){
				tp[j] = i;
				b[i][j] = b[j][i] = 1;
			}
		}
	}
	build(b);
	return 1;
}

Compilation message

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:15:24: error: 'n' was not declared in this scope
   15 |  vector<vector<int>> b(n, vector<int>(n));
      |                        ^