# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
933624 | vjudge1 | Speedrun (RMI21_speedrun) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "speedrun.h"
using namespace std;
using vi = vector <int>;
void assignHints (int subtask, int n, int u[], int v[]) {
if (subtask==1){setHintLen(n);
for (int i = 1; i <= n-1; i++) {
setHint(u[i], v[i], true);
setHint(v[i], u[i], true);
}
return;
}
if (subtask==2) {
setHintLen(20);
int freq[n+1]{};
for (int i=1; i <= n-1; i++) {
freq[u[i]]++;
freq[v[i]]++;
}
int u = max_element(freq, freq+n+1)-freq;
for (int i=1; i <= n; i++) {
for (int bit=0; bit < 20; bit++) {
setHint(i, bit+1, u>>bit&1);
}
}
return;}
bool vis[n+5]{};
vi adj[n+5];
for (int i = 1; i <= n-1; i++) {