Submission #230623

#TimeUsernameProblemLanguageResultExecution timeMemory
230623Dilshod_ImomovLibrary (JOI18_library)C++17
0 / 100
746 ms4360 KiB
#include <bits/stdc++.h> #include "library.h" using namespace std; const int N = 1e3 + 7; int used[N]; deque < int > vc = {1}; void rec( int x, int n ) { vector < int > m(n); m[x - 1] = 1; int cnt = 0; used[x] = 1; for ( int i = 1; i <= n; i++ ) { if ( used[i] ) { continue; } m[i - 1] = 1; int y = Query( m ); if ( y == 1 ) { if ( cnt ) { vc.push_front(i); cnt++; rec( i, n ); } else { vc.push_back( i ); cnt++; rec( i, n ); } } m[i - 1] = 0; } } void Solve(int n) { rec( 1, n ); vector < int > res; for ( auto i: vc ) { res.push_back( i ); } Answer(res); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...