#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 ;
if ( Query(cur) == 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 time |
Memory |
Grader output |
1 |
Correct |
184 ms |
280 KB |
# of queries: 12617 |
2 |
Runtime error |
251 ms |
280 KB |
Execution killed with signal 13 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
184 ms |
280 KB |
# of queries: 12617 |
2 |
Runtime error |
251 ms |
280 KB |
Execution killed with signal 13 |
3 |
Halted |
0 ms |
0 KB |
- |