#include "coloring.h"
#include <vector>
using namespace std;
int nxt[111];
void ColoringSame(int N) {
vector<int> lf;
for (int i=2;i<=N;i++) lf.push_back(i);
int last = 1;
for (int k=2;k<N;k++){
int l = 0, r = lf.size();
while (l + 1 < r){
int m = (l + r) / 2;
for (int i=l;i<m;i++) Color(lf[i]);
if (GetColor(last)){
r = m;
}
else l = m;
}
nxt[lf[l]] = last;
last = lf[l];
lf.erase(lf.begin()+l);
}
nxt[lf[0]] = last;
last = lf[0];
nxt[1] = last;
int x = 1;
while (1){
Color(x);
x = nxt[x];
if (x == 1) break;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1180 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |