# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
42832 | alenam0161 | Simurgh (IOI17_simurgh) | C++14 | 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 "simurgh.h"
#include <iostream>
#include <algorithm>
#include <cassert>
using namespace std;
#define DG(x) for(int i=0;i<(x).size();++i)cerr<<#x[i]<<" = "<<x[i]<<" ";
const int N = 5e2 + 7;
int used[N];
struct edge {
int ham, x;
};
vector<edge> g[N], ham[N],Nor[N];
vector<int> V, U;
bool is_it_in_T[N*N],Found[N*N];
int arj[N],Q[N];
int How[N*N];
int di[N];
int n,m;
void get_any(int v, vector<int> &T) {
used[v] = true;
for (auto to:g[v]) {
if (used[to.x])continue;
di[to.x] = di[v] + 1;
T.push_back(to.ham);
is_it_in_T[to.ham] = true;
get_any(to.x, T);
}
}
int par[N];
int find_par(int v) {