摘要:
d[i]表示在三根木棍的情况下,i个盘子要走d[i]步(注意,d[i] 当前i个盘子,三根木棍均可走) f[i]表示在四根木棍的情况下,i个盘子要走的最短步数f[i]步(注意,f[i] 当前i个盘子,四根木棍均可走) f[j] * 2 或 d[i - 1] * 2 表示拿下j(或i - 1)个盘子放 阅读全文
摘要:
#include <iostream> #include <cstring> using namespace std; const int INF = 0x3f3f3f3f; char g[10][10]; int dx[5] = {0, -1, 0, 1, 0}, dy[5] = {0, 0, 1, 0, -1}; void turn(int x, int y) { for(int i = 0; 阅读全文