int main() {
	unsigned int N;
	cin >> N;

	for (ui i = 0; i < N; i++) {
		ui height;
		cin >> height;

		heights.push_back(height);
	}

    //sort(ALL(heights), std::greater<int>());

	ui max = 0;
	for (ui i = 0; i < heights.size(); i++) {
		ui path = dfs(i, 0);

		if (path > max)
			max= path;
	}

	cout << max << endl;

	/*
    cout << N << endl;
    for (auto x : heights)
    	cout << x << "-";
    cout << endl;
    */

    return 0;
}
示例#2
0
void init_page_id_offsets() {
    goto_arena();
    CompressedFileReader offset_reader("page_id_stats", SMALL_CHUNK);
    offset_reader.read_ulong();
    for ( ui i = 0 ; i < number_of_files; i++ ) {
        page_id_offsets.push_back(offset_reader.read_ulong());
    }
}