Submission #1254454

#TimeUsernameProblemLanguageResultExecution timeMemory
1254454tkm_algorithmsMigrations (IOI25_migrations)C++20
10 / 100
28 ms528 KiB
/**
*    In the name of Allah
*    We are nothing and you're everything
*    Ya Muhammad!
**/
#include <bits/stdc++.h>
#include "migrations.h"
using namespace std;

#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define mp(x, y) make_pair(x, y)
const char nl = '\n';
const int N = 1e4+5;
int a[N], cnt = 1, mx = 0, id = 0;

int send_message(int n, int i, int pi) {
	a[i] = a[pi]+1;
	cnt += 1;
	if (mx<a[i])mx = a[i], id = i;
	if (cnt == n)return id;
	else return 0;
}

std::pair<int, int> longest_path(std::vector<int> s) {
	memset(a, 0, sizeof a);
	cnt = 1, mx = 0, id = 0;
	for (int i = 1; i < sz(s); ++i) {
		if (s[i]>0)return {0, s[i]};
	}
}

Compilation message (stderr)

migrations.cpp: In function 'std::pair<int, int> longest_path(std::vector<int>)':
migrations.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...