# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
344013 | juggernaut | Library (JOI18_library) | C++14 | 325 ms | 620 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"
#ifdef EVAL
#else
#include"grader.cpp"
#endif
using namespace std;
vector<int>g[205],ans;
void dfs(int v,int p){
ans.push_back(v+1);
for(int to:g[v])if(to!=p)dfs(to,v);
}
void Solve(int n){
vector<int>m(n,0);
for(int i=0;i+1<n;i++){
for(int j=i+1;j<n;j++){
m[i]=m[j]=1;
if(Query(m)==1){
g[i].push_back(j);
g[j].push_back(i);
}
m[i]=m[j]=0;
}
}
int root;
for(int i=0;i<n;i++)if(g[i].size()==1)root=i;
dfs(root,root);
Answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |