# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
230650 | Dilshod_Imomov | Library (JOI18_library) | C++17 | 3094 ms | 4448 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 "library.h"
using namespace std;
const int N = 1e3 + 7;
vector < int > adj[N], res;
int used[N], cnt[N][N];
void dfs( int v, int ind ) {
// cout << v << ' ' << ind << endl;
res[ind] = v;
used[v] = 1;
for ( auto u: adj[v] ) {
if ( !used[u] ) {
dfs( u, ind + 1 );
}
}
}
void Solve(int n)
{
vector < int > m(n);
res.assign(n, 0);
if ( n == 1 ) {
res[0] = 1;
Answer(res);
return;
}
for ( int i = 1; i <= n; i++ ) {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |