Submission #28692

#TimeUsernameProblemLanguageResultExecution timeMemory
28692뚜룹뚜룹뚜룹뚜스~>< (#68)1-Color Coloring (FXCUP2_coloring)C++11
0 / 1
0 ms1124 KiB
#include "coloring.h" #include <cstdio> #include <algorithm> using namespace std; int m; int arr[110], tarr[110]; void ColoringSame(int n){ int i, j, flag, l, r, mid, now = 1; for(i = 1; i < min(34, n - 1); i++){ m = 0; for(j = 2; j <= n; j++) if(!arr[j]) tarr[++m] = j; l = 1; r = m; while(l < r){ mid = (l + r) / 2; for(j = l; j <= mid; j++) Color(tarr[j]); flag = GetColor(now); if(flag) l = mid + 1; else r = mid - 1; } printf("%d %d ", now, tarr[l]); arr[tarr[l]] = now; now = tarr[l]; } for(i = 1; i < 68; i++){ Color(1); for(j = 2; j <= n; j++){ if(arr[j]) continue; Color(j); } } while(now != 1) Color(now), now = arr[now]; return; }
#Verdict Execution timeMemoryGrader output
Fetching results...