Submission #1265002

#TimeUsernameProblemLanguageResultExecution timeMemory
1265002martin_011Migrations (IOI25_migrations)C++20
16 / 100
28 ms532 KiB
#include "migrations.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vll; vll d(10001, 0); int send_message(int n, int i, int pi) { d[i] = d[pi] + 1; if (i== n-1) { ll nd = max_element(d.begin(), d.end()) - d.begin(); if (nd > 10) nd-=10; return nd; } if (i<=25) return d[i]; return 0; } std::pair<int, int> longest_path(std::vector<int> S) { ll n = S.size(); ll nd = S[n-1]; if (nd>10) return {0, nd+10}; if (d[nd] > d[nd+10]) { return {0, nd}; } else return {0, nd+10}; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...