# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
108738 | tjd229 | 1-Color Coloring (FXCUP2_coloring) | C++14 | 3 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "coloring.h"
#include <vector>
using namespace std;
int in[101];
void ColoringSame(int N) {
int i, j;
int coin = 200;
vector<int> v, stk;
int paint = 0;
for (stk.push_back(1),i = 2; i <= N; ++i) v.push_back(i);
while ( stk.size()!=N && coin>6) {
int l = 0, r = v.size()-1;
while (l < r) {
int m = (l + r) >> 1;
int half = (r - l + 1) >> 1;
for (i = l;half--; ++i) Color(v[i]),++paint;
--coin;
if(GetColor(stk.back())) l=i;
else r = i - 1;
}
stk.push_back(v[l]);
v.erase(v.begin()+l);
}
int pad = 0;
for (Color(1), i = 0; i < v.size(); ++i) {
if (i == 1) pad += 1;
if (i == 10)pad+=2;
for (j = 0; j < v.size()-pad; ++j)
Color(v[j]),++paint;
}
for (; stk.size() > 1; stk.pop_back()) Color(stk.back());
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |