답안 #574259

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
574259 2022-06-08T09:02:29 Z wjajjsasqq 분수 공원 (IOI21_parks) C++17
컴파일 오류
0 ms 0 KB
#include "keys.h"
#include <cassert>
#include <algorithm>

const int N = 300000;
int n, res[N];
bool u[N], vis[N];
std::vector<int> unlock[N];
std::vector<std::pair<int, int> > g[N];

std::vector<int> find_reachable(std::vector<int> r, std::vector<int> u, std::vector<int> v, std::vector<int> c) {
	n = r.size();
	for (int i = 0; i < (int)u.size(); ++i) {
		g[u[i]].push_back(std::make_pair(v[i], c[i]));
		g[v[i]].push_back(std::make_pair(u[i], c[i]));
	}
	for (int i = 0; i < n; ++i) {
		for (int i = 0; i < n; ++i) {
			u[i] = 0;
			vis[i] = 0;
			unlock[i].clear();
		}
		std::vector<int> vec;
		vec.push_back(i);
		vis[i] = 1;
		while (!vec.empty()) {
			int v = vec.back();
			if (vec.size() > n) {
				while (true);
			}
			vec.pop_back();
			++res[i];
			int c = r[v];
			if (!u[c]) {
				u[c] = 1;
				for (int i = 0; i < (int)unlock[c].size(); ++i) if (!vis[unlock[c][i]]) {
					vis[unlock[c][i]] = 1;
					vec.push_back(unlock[c][i]);
				}
			}
			for (int i = 0; i < (int)g[v].size(); ++i) if (!vis[g[v][i].first]) {
				if (u[g[v][i].second]) {
					vis[g[v][i].first] = 1;
					vec.push_back(g[v][i].first);
				} else unlock[g[v][i].second].push_back(g[v][i].first);
			}
		}
	}
	int mn = *std::min_element(res, res + n);
	std::vector<int> ans(n);
	for (int i = 0; i < n; ++i) ans[i] = mn == res[i];
	return ans;
}

Compilation message

parks.cpp:1:10: fatal error: keys.h: No such file or directory
    1 | #include "keys.h"
      |          ^~~~~~~~
compilation terminated.