Submission #1346016

#TimeUsernameProblemLanguageResultExecution timeMemory
1346016Jer이주 (IOI25_migrations)C++20
0 / 100
0 ms360 KiB
#include "migrations.h"
#include <bits/stdc++.h>

using namespace std;

const int MAXN = 10005;
int depth[MAXN], best_depth = -1, best = 0;

int send_message(int n, int i, int p)
{
	if (i != 0)
		depth[i] = depth[p] + 1;
	if (depth[i] > best_depth)
		best = i, best_depth = depth[i];
	if (i == n - 1)
		return best;
}

std::pair<int, int> longest_path(std::vector<int> s)
{
	return {0, s[s.size() - 1]};
}

Compilation message (stderr)

migrations.cpp: In function 'int send_message(int, int, int)':
migrations.cpp:17:1: warning: control reaches end of non-void function [-Wreturn-type]
   17 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...