#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);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
219 ms |
384 KB |
Wrong Answer [8] |
2 |
Incorrect |
182 ms |
520 KB |
Wrong Answer [8] |
3 |
Incorrect |
212 ms |
504 KB |
Wrong Answer [8] |
4 |
Incorrect |
222 ms |
504 KB |
Wrong Answer [8] |
5 |
Incorrect |
224 ms |
568 KB |
Wrong Answer [8] |
6 |
Incorrect |
206 ms |
508 KB |
Wrong Answer [8] |
7 |
Incorrect |
214 ms |
384 KB |
Wrong Answer [8] |
8 |
Incorrect |
199 ms |
528 KB |
Wrong Answer [8] |
9 |
Incorrect |
223 ms |
632 KB |
Wrong Answer [8] |
10 |
Incorrect |
84 ms |
384 KB |
Wrong Answer [8] |
11 |
Correct |
5 ms |
256 KB |
# of queries: 0 |
12 |
Correct |
4 ms |
256 KB |
# of queries: 1 |
13 |
Correct |
4 ms |
256 KB |
# of queries: 3 |
14 |
Correct |
5 ms |
256 KB |
# of queries: 4 |
15 |
Correct |
6 ms |
256 KB |
# of queries: 75 |
16 |
Incorrect |
7 ms |
384 KB |
Wrong Answer [8] |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
219 ms |
384 KB |
Wrong Answer [8] |
2 |
Incorrect |
182 ms |
520 KB |
Wrong Answer [8] |
3 |
Incorrect |
212 ms |
504 KB |
Wrong Answer [8] |
4 |
Incorrect |
222 ms |
504 KB |
Wrong Answer [8] |
5 |
Incorrect |
224 ms |
568 KB |
Wrong Answer [8] |
6 |
Incorrect |
206 ms |
508 KB |
Wrong Answer [8] |
7 |
Incorrect |
214 ms |
384 KB |
Wrong Answer [8] |
8 |
Incorrect |
199 ms |
528 KB |
Wrong Answer [8] |
9 |
Incorrect |
223 ms |
632 KB |
Wrong Answer [8] |
10 |
Incorrect |
84 ms |
384 KB |
Wrong Answer [8] |
11 |
Correct |
5 ms |
256 KB |
# of queries: 0 |
12 |
Correct |
4 ms |
256 KB |
# of queries: 1 |
13 |
Correct |
4 ms |
256 KB |
# of queries: 3 |
14 |
Correct |
5 ms |
256 KB |
# of queries: 4 |
15 |
Correct |
6 ms |
256 KB |
# of queries: 75 |
16 |
Incorrect |
7 ms |
384 KB |
Wrong Answer [8] |
17 |
Incorrect |
654 ms |
480 KB |
Wrong Answer [3] |
18 |
Incorrect |
723 ms |
944 KB |
Wrong Answer [3] |
19 |
Incorrect |
707 ms |
504 KB |
Wrong Answer [3] |
20 |
Incorrect |
621 ms |
632 KB |
Wrong Answer [3] |
21 |
Incorrect |
596 ms |
736 KB |
Wrong Answer [3] |
22 |
Incorrect |
651 ms |
632 KB |
Wrong Answer [3] |
23 |
Incorrect |
746 ms |
732 KB |
Wrong Answer [3] |
24 |
Incorrect |
500 ms |
568 KB |
Wrong Answer [3] |
25 |
Incorrect |
733 ms |
504 KB |
Wrong Answer [3] |
26 |
Incorrect |
644 ms |
584 KB |
Wrong Answer [3] |
27 |
Incorrect |
474 ms |
524 KB |
Wrong Answer [3] |
28 |
Correct |
37 ms |
4344 KB |
# of queries: 999 |
29 |
Correct |
33 ms |
4360 KB |
# of queries: 998 |
30 |
Correct |
34 ms |
4344 KB |
# of queries: 999 |