# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
108737 | 2019-05-01T08:02:01 Z | tjd229 | 1-Color Coloring (FXCUP2_coloring) | C++14 | 3 ms | 384 KB |
#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 == 5)++pad; for (j = 0; j < v.size()-pad; ++j) Color(v[j]),++paint; } for (; stk.size() > 1; stk.pop_back()) Color(stk.back()); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 3 ms | 384 KB | Output is correct |
4 | Correct | 3 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 3 ms | 384 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 256 KB | Output is correct |
9 | Runtime error | 2 ms | 256 KB | Execution failed because the return code was nonzero |
10 | Halted | 0 ms | 0 KB | - |