(int s, int x)
| 183 | public static int a, b; |
| 184 | |
| 185 | public static void travel(int s, int x) { |
| 186 | a = 0; |
| 187 | b = 0; |
| 188 | for (int p = MAXP; p >= 0; p--) { |
| 189 | if (stto[s][p] != 0 && x >= stdist[s][p]) { |
| 190 | x -= stdist[s][p]; |
| 191 | a += sta[s][p]; |
| 192 | b += stb[s][p]; |
| 193 | s = stto[s][p]; |
| 194 | } |
| 195 | } |
| 196 | if (dist2[s] <= x) { |
| 197 | a += dist2[s]; |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | } |