Submission #344037

# Submission time Handle Problem Language Result Execution time Memory
344037 2021-01-05T04:59:08 Z juggernaut Library (JOI18_library) C++14
0 / 100
242 ms 620 KB
#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;
    if(n==1)root=0;
    else{
        int l=0,r=n-1;
        while(l<r){
            int mid=(l+r)>>1;
            vector<int>tmp=m;
            for(int i=l;i<=mid;i++)tmp[i]=1;
            int x=Query(tmp);
            for(int i=l;i<=r;i++)tmp[i]^=1;
            int y=Query(tmp);
            if(x>=y)r=mid;
            else l=mid+1;
        }
        root=l;
    }
    dfs(root,root);
    Answer(ans);
}
# Verdict Execution time Memory Grader output
1 Incorrect 242 ms 620 KB Wrong Answer [8]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 242 ms 620 KB Wrong Answer [8]
2 Halted 0 ms 0 KB -