Submission #47827

#TimeUsernameProblemLanguageResultExecution timeMemory
47827TalantLibrary (JOI18_library)C++17
19 / 100
2029 ms796 KiB
#include <cstdio> #include <vector> #include <bits/stdc++.h> #include "library.h" #define pb push_back using namespace std; int deg[1005]; vector <int> g[1005],res; void dfs (int v,int p = -1) { res.pb(v + 1); for (auto to : g[v]) if (to != p) dfs(to,v); } void Solve(int N) { vector<int> M(N); int cur = 0; for (int i = 0; i < N; i ++) { for (int j = i + 1; j < N; j ++) { M[i] = M[j] = 1; int o = Query(M); if (o == 1) { g[i].pb(j); g[j].pb(i); deg[i] ++; deg[j] ++; } M[i] = M[j] = 0; } } for (int i = 0; i < N; i ++) { if (deg[i] == 1) { cur = i; break; } } dfs(cur); Answer(res); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...