// correct/BM-subtask4.cpp
#include "sphinx.h"
using namespace std;
vector<int> find_colours(int N, vector<int> /*X*/, vector<int> /*Y*/) {
vector<int> F(N);
vector<int> ord(N);
for (int i = 0; i < N; i++) {
int a = 0, b = N - 1;
while (a != b) {
int pos = a, half = (a + b) / 2;
for (int j = 0; j < N; j++) {
if (i == j) {
ord[j] = -1;
} else if (pos <= half) {
ord[j] = pos++;
} else {
ord[j] = N;
}
}
int cc = perform_experiment(ord);
if (cc == half - a + 1 + 1 + (N > 2 ? 1 : 0)) {
a = half + 1;
} else {
b = half;
}
}
F[i] = a;
}
return F;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
344 KB |
Partially correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
#experiments: 2 |
2 |
Correct |
0 ms |
344 KB |
#experiments: 2 |
3 |
Correct |
0 ms |
352 KB |
#experiments: 2 |
4 |
Correct |
1 ms |
344 KB |
#experiments: 2 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
344 KB |
Partially correct |
2 |
Correct |
0 ms |
344 KB |
#experiments: 2 |
3 |
Correct |
0 ms |
344 KB |
#experiments: 2 |
4 |
Correct |
0 ms |
352 KB |
#experiments: 2 |
5 |
Correct |
1 ms |
344 KB |
#experiments: 2 |
6 |
Incorrect |
4 ms |
352 KB |
Vertices 2 and 3 do have the same color, but they do not in returned answer |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
#experiments: 2 |
2 |
Correct |
0 ms |
344 KB |
#experiments: 2 |
3 |
Correct |
0 ms |
352 KB |
#experiments: 2 |
4 |
Correct |
1 ms |
344 KB |
#experiments: 2 |
5 |
Incorrect |
4 ms |
352 KB |
Vertices 2 and 3 do have the same color, but they do not in returned answer |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
#experiments: 2 |
2 |
Correct |
0 ms |
344 KB |
#experiments: 2 |
3 |
Correct |
0 ms |
352 KB |
#experiments: 2 |
4 |
Correct |
1 ms |
344 KB |
#experiments: 2 |
5 |
Correct |
4 ms |
600 KB |
#experiments: 300 |
6 |
Correct |
4 ms |
348 KB |
#experiments: 276 |
7 |
Correct |
3 ms |
352 KB |
#experiments: 269 |
8 |
Correct |
3 ms |
344 KB |
#experiments: 276 |
9 |
Correct |
3 ms |
344 KB |
#experiments: 286 |
10 |
Correct |
2 ms |
344 KB |
#experiments: 282 |
11 |
Correct |
4 ms |
344 KB |
#experiments: 288 |
12 |
Correct |
3 ms |
344 KB |
#experiments: 286 |
13 |
Correct |
45 ms |
856 KB |
#experiments: 2000 |
14 |
Correct |
74 ms |
856 KB |
#experiments: 2000 |
15 |
Correct |
54 ms |
856 KB |
#experiments: 1987 |
16 |
Correct |
50 ms |
856 KB |
#experiments: 1997 |
17 |
Correct |
52 ms |
856 KB |
#experiments: 1985 |
18 |
Correct |
48 ms |
664 KB |
#experiments: 1999 |
19 |
Correct |
55 ms |
660 KB |
#experiments: 1992 |
20 |
Correct |
52 ms |
856 KB |
#experiments: 2000 |
21 |
Correct |
45 ms |
856 KB |
#experiments: 1994 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
344 KB |
Partially correct |
2 |
Correct |
0 ms |
344 KB |
#experiments: 2 |
3 |
Correct |
0 ms |
344 KB |
#experiments: 2 |
4 |
Correct |
0 ms |
352 KB |
#experiments: 2 |
5 |
Correct |
1 ms |
344 KB |
#experiments: 2 |
6 |
Incorrect |
4 ms |
352 KB |
Vertices 2 and 3 do have the same color, but they do not in returned answer |
7 |
Halted |
0 ms |
0 KB |
- |