답안 #108826

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
108826 2019-05-02T08:52:45 Z tictaccat 도서관 (JOI18_library) C++11
0 / 100
2000 ms 420 KB
#include <cstdio>
#include <vector>
#include "library.h"
#include <bits/stdc++.h>
using namespace std;

void Solve(int N)
{

	srand(time(0));

	vector<int> M(N,1), indices(N);

	iota(indices.begin(),indices.end(),0);
	random_shuffle(indices.begin(),indices.end());

	vector<int> res(N);
	vector<bool> found(N);

	for (res[0] = 0; res[0] < N; res[0]++) {
		M[res[0]] = 0;
		if (Query(M) == 1) {
			found[res[0]] = true;
			break;
		}
		M[res[0]] = 1;
	}

	M = vector<int>(N,0);
	M[res[0]] = 1;

	for (int k = 1; k < N; k++) {
		for (int i: indices) {
			if (found[i]) continue;
			M[i] = 1;
			if (Query(M) == 1) {
				res[k] = i;
				found[i] = true;
				break;
			}
			M[i] = 0;
		}
	}

	// for (int i = 0; i < N; i++) {
	// 	res[i]++;
	// 	cout << res[i] << " ";
	// }

	// cout << "\n";

	Answer(res);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 108 ms 384 KB Wrong Answer [5]
2 Incorrect 135 ms 384 KB Wrong Answer [5]
3 Incorrect 169 ms 256 KB Wrong Answer [5]
4 Incorrect 119 ms 384 KB Wrong Answer [5]
5 Incorrect 143 ms 304 KB Wrong Answer [5]
6 Incorrect 146 ms 384 KB Wrong Answer [5]
7 Incorrect 143 ms 384 KB Wrong Answer [5]
8 Incorrect 114 ms 256 KB Wrong Answer [5]
9 Incorrect 135 ms 384 KB Wrong Answer [5]
10 Incorrect 40 ms 328 KB Wrong Answer [5]
11 Incorrect 2 ms 256 KB Wrong Answer [2]
12 Incorrect 2 ms 256 KB Wrong Answer [5]
13 Incorrect 2 ms 300 KB Wrong Answer [5]
14 Incorrect 2 ms 256 KB Wrong Answer [5]
15 Incorrect 4 ms 384 KB Wrong Answer [5]
16 Incorrect 5 ms 256 KB Wrong Answer [5]
# 결과 실행 시간 메모리 Grader output
1 Incorrect 108 ms 384 KB Wrong Answer [5]
2 Incorrect 135 ms 384 KB Wrong Answer [5]
3 Incorrect 169 ms 256 KB Wrong Answer [5]
4 Incorrect 119 ms 384 KB Wrong Answer [5]
5 Incorrect 143 ms 304 KB Wrong Answer [5]
6 Incorrect 146 ms 384 KB Wrong Answer [5]
7 Incorrect 143 ms 384 KB Wrong Answer [5]
8 Incorrect 114 ms 256 KB Wrong Answer [5]
9 Incorrect 135 ms 384 KB Wrong Answer [5]
10 Incorrect 40 ms 328 KB Wrong Answer [5]
11 Incorrect 2 ms 256 KB Wrong Answer [2]
12 Incorrect 2 ms 256 KB Wrong Answer [5]
13 Incorrect 2 ms 300 KB Wrong Answer [5]
14 Incorrect 2 ms 256 KB Wrong Answer [5]
15 Incorrect 4 ms 384 KB Wrong Answer [5]
16 Incorrect 5 ms 256 KB Wrong Answer [5]
17 Execution timed out 3076 ms 412 KB Time limit exceeded
18 Execution timed out 3030 ms 336 KB Time limit exceeded
19 Execution timed out 3087 ms 384 KB Time limit exceeded
20 Execution timed out 3048 ms 256 KB Time limit exceeded
21 Execution timed out 3097 ms 384 KB Time limit exceeded
22 Execution timed out 3053 ms 384 KB Time limit exceeded
23 Execution timed out 3078 ms 340 KB Time limit exceeded
24 Incorrect 1580 ms 384 KB Wrong Answer [3]
25 Execution timed out 3079 ms 256 KB Time limit exceeded
26 Execution timed out 3096 ms 384 KB Time limit exceeded
27 Incorrect 1576 ms 256 KB Wrong Answer [3]
28 Execution timed out 3019 ms 420 KB Time limit exceeded
29 Execution timed out 3046 ms 420 KB Time limit exceeded
30 Execution timed out 3081 ms 256 KB Time limit exceeded