Submission #582161

#TimeUsernameProblemLanguageResultExecution timeMemory
582161YaserFaisalLibrary (JOI18_library)C++14
0 / 100
316 ms280 KiB
#include "library.h" #include <bits/stdc++.h> using namespace std; void Solve(int n) { if ( n == 1 ) { vector < int > x = {1} ; Answer(x) ; return ; } vector < int > ans , v(n,0) , cur ; for ( int i = 0 ; i < n ; i++ ) { int sum = 0 ; for ( int j = 0 ; j < n ; j++ ) { if ( i == j ) continue; cur = v ; cur[i] = cur[j] = 1 ; if ( Query(cur) == 1 ) sum++ ; } if ( sum == 1 ) { ans.push_back(i) ; break ; } } for ( int i = 1 ; i < n ; i++ ) { int m = ans.size() - 1 ; v[ans[m]] = 1 ; for ( int j = 0 ; j < n ; j++ ) { if ( v[j] == 1 ) continue; cur = v ; cur[j] = 1 ; int y = Query(cur) ; if ( y > 2 ) { while(true) { } } if ( y == 1 ) { ans.push_back(j) ; break ; } } } for ( int i = 0 ; i < n ; i++ ) ans[i]++ ; Answer(ans) ; } // Query(x) , x : where x is a vector with 0 or 1 // Answer(x) . x : where x is a vector with number from 1 -> n
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...