| 133 | } |
| 134 | |
| 135 | private static boolean init2() { |
| 136 | int epx = ep, cpx = cp; |
| 137 | for (int i = len1; i > 0; i--) { |
| 138 | int m = sol[i] / 3, t = sol[i] % 3; |
| 139 | epx = epm[epx][m]; cpx = Tower.cpm[cpx][m]; |
| 140 | if (t > 0) { |
| 141 | epx = epm[epx][m]; cpx = Tower.cpm[cpx][m]; |
| 142 | if (t > 1) { |
| 143 | epx = epm[epx][m]; cpx = Tower.cpm[cpx][m]; |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | epx = getMi(epx); |
| 148 | int lf = sol[1] / 3; |
| 149 | if (lf == 0) lf = -1; |
| 150 | for (len2 = 0; len2 < 19 - len1; len2++) { |
| 151 | if (search2(cpx, epx, len2, lf)) { |
| 152 | if (len1 + len2 < 4) continue; |
| 153 | return true; |
| 154 | } |
| 155 | } |
| 156 | return false; |
| 157 | } |
| 158 | |
| 159 | private static boolean search2(int cp, int ep, int d, int lf) { |
| 160 | if (d == 0) return cp == 0 && ep == 0; |