# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
28447 | not good but never sad (#68) | 1-Color Coloring (FXCUP2_coloring) | C++98 | 0 ms | 1176 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;
void ColoringSame(int N) {
vector<int> lf;
for (int i=2;i<=N;i++) lf.push_back(i);
int last = 1;
vector<int> see;
int att = 200;
for (int k=2;k<N;k++){
int l = 0, r = lf.size();
if (att - 7 < 0) break;
while (l + 1 < r){
int m = (l + r) / 2;
att--;
if (att < 0) break;
for (int i=l;i<m;i++) Color(lf[i]);
if (GetColor(last)) l = m;
else r = m;
}
if (att < 0) break;
see.push_back(lf[l]);
last = lf[l];
lf.erase(lf.begin()+l);
}
lf.insert(lf.begin(),1);
for (int i=0;i<lf.size();i++){
for (int j=0;j<lf.size();j++) Color(lf[j]);
}
while (!see.empty()){
Color(see.back());
see.pop_back();
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |