Submission #1148576

#TimeUsernameProblemLanguageResultExecution timeMemory
1148576zhasyn슈퍼트리 잇기 (IOI20_supertrees)C++20
Compilation error
0 ms0 KiB
#include "supertrees.h"
#include <bits/stdc++.h>
#define pb push_back
#define pf push_front
using namespace std;
#define F first
#define S second
typedef long long ll;
#define pii pair <int, int>
#define pll pair <ll, ll>
typedef long double ld;
const ll N = 1000 + 100, M = 4096 + 10, len = 21, inf = 1e18;
const ll mod = 1e9 + 7;
vector <int> q[N];
vector<vector<int>> answer;
void dfs(int v){
	was[v] = true;
	for(auto u : q[v]){
		if(was[u]) continue;
		ans[u][v] = ans[v][u] = 1;
	}
}
int construct(vector<vector<int>> p) {
	int n = p.size();
	for (int i = 0; i < n; i++) {
		vector<int> row;
		row.resize(n);
		answer.push_back(row);
	}
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			if(p[i][j] == 1){
				q[i].pb(j);
				q[j].pb(i);
			}
		}
	}
	for(int i = 0; i < n; i++){
		if(was[i] == false) dfs(i);
	}
	build(answer);
	return 1;
}

// int main() {
  // ios::sync_with_stdio(false);
  // cin.tie(NULL);
//   
//   
  // return 0;
// }

Compilation message (stderr)

supertrees.cpp: In function 'void dfs(int)':
supertrees.cpp:17:9: error: 'was' was not declared in this scope
   17 |         was[v] = true;
      |         ^~~
supertrees.cpp:20:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |                 ans[u][v] = ans[v][u] = 1;
      |                 ^~~
      |                 abs
supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:39:20: error: 'was' was not declared in this scope
   39 |                 if(was[i] == false) dfs(i);
      |                    ^~~