#include "coloring.h"
#include <cstdio>
#include <algorithm>
using namespace std;
int arr[110];
void ColoringSame(int n){
int i, j, flag, l, r, mid, now = 1;
for(i = 1; i < min(20, n - 1); i++){
l = 1; r = n;
while(l <= r){
mid = (l + r) / 2;
for(j = l; j <= mid; j++){
if(arr[j] || j == 1) continue;
Color(j);
}
flag = GetColor(now);
if(flag) l = mid + 1;
else r = mid - 1;
}
arr[l] = now; now = l;
}
for(i = 1; i < 72; i++){
Color(1);
for(j = 2; j <= n; j++){
if(arr[j]) continue;
Color(j);
}
}
while(now != 1) Color(now), now = arr[now];
return;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1124 KB |
Output is correct |
2 |
Correct |
0 ms |
1124 KB |
Output is correct |
3 |
Correct |
0 ms |
1124 KB |
Output is correct |
4 |
Correct |
0 ms |
1124 KB |
Output is correct |
5 |
Correct |
0 ms |
1124 KB |
Output is correct |
6 |
Correct |
0 ms |
1124 KB |
Output is correct |
7 |
Correct |
0 ms |
1124 KB |
Output is correct |
8 |
Correct |
0 ms |
1124 KB |
Output is correct |
9 |
Correct |
0 ms |
1124 KB |
Output is correct |
10 |
Correct |
0 ms |
1124 KB |
Output is correct |
11 |
Correct |
0 ms |
1124 KB |
Output is correct |
12 |
Correct |
0 ms |
1124 KB |
Output is correct |
13 |
Correct |
0 ms |
1124 KB |
Output is correct |
14 |
Correct |
0 ms |
1124 KB |
Output is correct |
15 |
Correct |
0 ms |
1124 KB |
Output is correct |
16 |
Incorrect |
0 ms |
1124 KB |
Output isn't correct |
17 |
Halted |
0 ms |
0 KB |
- |