/**
* 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, gos = 0;
int send_message(int n, int i, int pi) {
a[i] = a[pi]+1;
cnt += 1;
//if (cnt == n)return gos+211;
if (mx<a[i])gos += a[i]-mx, mx = a[i];
//if (gos == 211) {
//gos = 0;
//return 1;
//}
//else
return 0;
}
std::pair<int, int> longest_path(std::vector<int> s) {
for (int i = 1; i < sz(s); ++i)if (a[i] == mx)return {0, i};
memset(a, 0, sizeof a);
cnt = 1, mx = 0, id = 0;
//for (int i = 1; i < sz(s); ++i) {
//if (s[i] == 1)
//}
}
Compilation message (stderr)
migrations.cpp: In function 'std::pair<int, int> longest_path(std::vector<int>)':
migrations.cpp:33:29: warning: control reaches end of non-void function [-Wreturn-type]
33 | cnt = 1, mx = 0, id = 0;
| ~~~^~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |