제출 #818480

#제출 시각아이디문제언어결과실행 시간메모리
818480pavementLongest beautiful sequence (IZhO17_subsequence)C++17
컴파일 에러
0 ms0 KiB
#include "bitseq.h"
#include <bits/stdc++.h>
using namespace std;

vector<int> bitseq(vector<int> a, vector<int> c) {
	const int k = 10;
	int n = a.size(), cl[1 << k][1 << k][k + 1];
	vector<int> dp(n, 1), prv(n, -1);
	memset(cl, -1, sizeof cl);
	for (int i = 0; i < n; i++) {
		for (int lh = 0; lh < (1 << k); lh++) {
			int rh = a[i] >> k;
			int lh_i = a[i] & ((1 << k) - 1);
			if (c[i] < __builtin_popcount(lh & lh_i) || c[i] - __builtin_popcount(lh & lh_i) > k) {
				continue;
			}
			int to = cl[lh][rh][c[i] - __builtin_popcount(lh & lh_i)];
			if (to != -1) {
				if (dp[to] + 1 > dp[i]) {
					dp[i] = dp[to] + 1;
					prv[i] = to;
				}
			}
		}
		for (int rh = 0; rh < (1 << k); rh++) {
			int lh = a[i] & ((1 << k) - 1);
			int rh_i = (a[i] ^ lh) >> k;
			if (cl[lh][rh][__builtin_popcount(rh & rh_i)] == -1 || dp[cl[lh][rh][__builtin_popcount(rh & rh_i)]] < dp[i]) {
				cl[lh][rh][__builtin_popcount(rh & rh_i)] = i;
			}
		}
	}
	int mx = -1;
	for (int i = 0; i < n; i++) {
		if (mx == -1 || dp[i] >= dp[mx]) {
			mx = i;
		}
	}
	vector<int> ret;
	while (mx != -1) {
		ret.push_back(mx + 1);
		mx = prv[mx];
	}
	reverse(ret.begin(), ret.end());
	return ret;
}

컴파일 시 표준 에러 (stderr) 메시지

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