public void Solve() { Func <int, int, wb[]> paintColor = null; paintColor = (from, now) => { var ret = new wb[2] { 1, 1 }; foreach (var to in abList[now]) { // ?????? ??????????? if (from == to) { continue; } var res = paintColor(now, to); // ???+? ret[0] *= res[0] + res[1]; // ??? ret[1] *= res[0]; } return(ret); }; var ans = paintColor(-1, 0); Console.WriteLine((ans[0] + ans[1]).num); }
wb[] paintColor(int from, int now) { var ret = new wb[2] { 1, 1 }; foreach (var to in abList[now]) { // ?????? ??????????? if (from == to) { continue; } var res = paintColor(now, to); // ???+? ret[0] *= res[0] + res[1]; // ??? ret[1] *= res[0]; } return(ret); }
=> FuncParse = () => ExtendFromWorkbook(wb, excludedSheetNames);