Submission #1138657

#TimeUsernameProblemLanguageResultExecution timeMemory
1138657adiyerSeptember (APIO24_september)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include <september.h>

using namespace std;

const int MAXN = 1e5 + 11;

int p[MAXN];

bool mrk[MAXN];

vector < int > g[MAXN];

void up(int v){
	if(v == 0 || mrk[v]) return;
	mrk[v] = 1, up(p[v]);
}

int solve(int N, int M, vector<int> F, vector<vector<int>> S) {\
	for(int i = 0; i < N; i++){
		p[i] = F[i];
		g[i].clear();
		mrk[i] = 0;
	}
	for(int i = 1; i < N; i++){
		g[p[i]].push_back(i);
	}
	int lst = 0, cnt = 0;
	for(int i = 0; i < N - 1; i++){
		bool ok = 1;
		for(int j = 0; j < N; j++) mrk[j] = 0;
		for(int j = i + 1; j < N; j++) up(j);
		for(int j = lst; j <= i; j++)
			if(mrk[j])
				ok = 0;
		if(ok) cnt++, lst = i + 1;
	}
	return cnt;
}

Compilation message (stderr)

september.cpp:2:10: fatal error: september.h: No such file or directory
    2 | #include <september.h>
      |          ^~~~~~~~~~~~~
compilation terminated.