답안 #833644

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
833644 2023-08-22T07:22:42 Z caganyanmaz 고대 책들 (IOI17_books) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#define pb push_back
#include "books.h"
#define ll long long 
using namespace std;

#define DEBUGGING
#ifdef DEBUGGING
#include "../debug.h"
#else
#define debug(x...) void(42)
#endif

struct Node
{
	int head, tail, size, nxt;
	Node(int i) : head(i), tail(i), size(1), nxt(-1) {}
	Node() : Node(-1) {}

};

constexpr static int MXN = 1e6;
Node node[MXN];
bitset<MXN> visited;
bitset<MXN> visited_component;


void merge(int a, int b);

ll minimum_walk(vector<int> p, int s) 
{
	int n = p.size();
	ll sum = 0;
	int current = 0;
	vector<int> rp(n);
	for (int i = 0; i < n; i++)
		rp[p[i]] = i;
	vector<int> pp;
	int spos = MXN;
	int epos = -MXN;
	vector<int> v;
	for (int i = 0; i < n; i++)
	{
		if (current > 0)
		{
			spos = min(spos, i);
			epos = max(epos, i);
		}
		sum += current * 2;
		v.pb(current);
		if (p[i] > i)
			current++;
		else if (rp[i] < i)
			current--;
	}
	for (int i = spos; i <= epos; i++)
		if (v[i] <= 0)
			sum += 2;
	return sum;
}

void merge(int a, int b)
{
	if (node[a].size < node[b].size) swap(a, b);
	node[a].size += node[b].size;
	node[node[a].tail].nxt = b;
	node[a].tail = node[b].tail;
	for (;b!=-1;b=node[b].nxt)
		node[b].head = a;
}

Compilation message

books.cpp:9:10: fatal error: ../debug.h: No such file or directory
    9 | #include "../debug.h"
      |          ^~~~~~~~~~~~
compilation terminated.