# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
28333 | not good but never sad (#68) | 1-Color Coloring (FXCUP2_coloring) | C++11 | 0 ms | 1180 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |