# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
108693 | tjd229 | 1-Color Coloring (FXCUP2_coloring) | C++14 | 4 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "coloring.h"
#include <vector>
using namespace std;
int in[101];
void ColoringSame(int N){
int i,j,coin=200;
int pad[7] = { 0 };
vector<int> bit_vec[7],stk,v;
for (i = 2; i <= N; ++i) {
for (int j = 0, n = i; j < 7; ++j) {
if (n & 1) bit_vec[j].push_back(i);
n >>= 1;
}
}
stk.push_back(1);
while (coin) {
int nxt = 0;
int back = stk.back();
for (j = 0; j < 7 && coin; ++j) {
if (bit_vec[j].size() - pad[j]) {
for (auto x : bit_vec[j]) if(!in[x]) Color(x);
}
if (!GetColor(1)) nxt |= (1 << j);
--coin;
}
if (j > 7) {
stk.push_back(nxt);
in[nxt] = 1;
for (j = 0; j < 7; ++j) {
if (nxt & 1) ++pad[j];
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |