Submission #230627

# Submission time Handle Problem Language Result Execution time Memory
230627 2020-05-10T16:00:25 Z Dilshod_Imomov Library (JOI18_library) C++17
0 / 100
2000 ms 4344 KB
#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;
	// cout << x << '\n';
	vc.push_back( x );
	for ( int i = 1; i <= n; i++ ) {
		if ( used[i] ) {
			continue;
		}
		m[i - 1] = 1;
		int y = Query( m );
		if ( y == 1 ) {
			cnt++;
			rec( i, n );
			used[i] = 0;
			return;
		}
		m[i - 1] = 0;
	}
}

void Solve(int n)
{	
	for ( int i = 1; i <= n; i++ ) {
		vc.clear();
		// cout << "------------------\n";
		rec( i, n );
		if ( (int)vc.size() == n ) {
			vector < int > res;
			for ( auto j: vc ) {
				res.push_back( j );
			}
			Answer(res);
			break;
		}
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 362 ms 376 KB Wrong Answer [3]
2 Incorrect 339 ms 396 KB Wrong Answer [3]
3 Incorrect 342 ms 504 KB Wrong Answer [3]
4 Incorrect 355 ms 432 KB Wrong Answer [3]
5 Incorrect 350 ms 632 KB Wrong Answer [3]
6 Incorrect 358 ms 384 KB Wrong Answer [3]
7 Incorrect 343 ms 384 KB Wrong Answer [3]
8 Incorrect 391 ms 376 KB Wrong Answer [3]
9 Incorrect 355 ms 632 KB Wrong Answer [3]
10 Incorrect 296 ms 384 KB Wrong Answer [3]
11 Correct 4 ms 384 KB # of queries: 0
12 Correct 5 ms 256 KB # of queries: 1
13 Incorrect 4 ms 256 KB Wrong Answer [7]
14 Correct 5 ms 384 KB # of queries: 4
15 Correct 5 ms 256 KB # of queries: 75
16 Incorrect 18 ms 256 KB Wrong Answer [7]
# Verdict Execution time Memory Grader output
1 Incorrect 362 ms 376 KB Wrong Answer [3]
2 Incorrect 339 ms 396 KB Wrong Answer [3]
3 Incorrect 342 ms 504 KB Wrong Answer [3]
4 Incorrect 355 ms 432 KB Wrong Answer [3]
5 Incorrect 350 ms 632 KB Wrong Answer [3]
6 Incorrect 358 ms 384 KB Wrong Answer [3]
7 Incorrect 343 ms 384 KB Wrong Answer [3]
8 Incorrect 391 ms 376 KB Wrong Answer [3]
9 Incorrect 355 ms 632 KB Wrong Answer [3]
10 Incorrect 296 ms 384 KB Wrong Answer [3]
11 Correct 4 ms 384 KB # of queries: 0
12 Correct 5 ms 256 KB # of queries: 1
13 Incorrect 4 ms 256 KB Wrong Answer [7]
14 Correct 5 ms 384 KB # of queries: 4
15 Correct 5 ms 256 KB # of queries: 75
16 Incorrect 18 ms 256 KB Wrong Answer [7]
17 Execution timed out 3019 ms 480 KB Time limit exceeded
18 Execution timed out 3022 ms 504 KB Time limit exceeded
19 Execution timed out 3092 ms 656 KB Time limit exceeded
20 Execution timed out 3028 ms 504 KB Time limit exceeded
21 Execution timed out 3009 ms 504 KB Time limit exceeded
22 Execution timed out 3097 ms 552 KB Time limit exceeded
23 Execution timed out 3018 ms 608 KB Time limit exceeded
24 Incorrect 1145 ms 632 KB Wrong Answer [3]
25 Execution timed out 3090 ms 632 KB Time limit exceeded
26 Execution timed out 3018 ms 636 KB Time limit exceeded
27 Incorrect 1169 ms 504 KB Wrong Answer [3]
28 Correct 35 ms 4344 KB # of queries: 999
29 Correct 34 ms 4344 KB # of queries: 998
30 Correct 34 ms 4344 KB # of queries: 999