Submission #139467

#TimeUsernameProblemLanguageResultExecution timeMemory
139467zoooma13Library (JOI18_library)C++14
0 / 100
3092 ms504 KiB
#include "bits/stdc++.h" #include "library.h" using namespace std; #define MAX_N 202 void Solve(int N) { vector <int> M(N); vector <vector<int>> adj(N); for(int i=0; i<N; i++){ M[i] = 1; for(int j=i+1; j<N; j++){ M[j] = 1; if(Query(M) == 1) adj[i].push_back(j), adj[j].push_back(i); M[j] = 0; } M[i] = 0; } int st; for(int i=0; i<N; i++) if(adj[i].size() == 1) st = i; vector <int> res; for(int i=0; i<N; i++){ res.push_back(st+1); int to = adj[st].front(); adj[to].erase(find(adj[to].begin() ,adj[to].end() ,st)); st = to; } Answer(res); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...