2012年7月20日

HDOJ Another Eight Puzzle

摘要: 根据题目描述,可以知道 1 和 8 只能放在 C 和 F 两个位置,固定好 1 和 8 后,2 和 7 也就固定了,剩下的就是枚举了;View Code # include <cstdio>const int tab[][8] = { {7, 3, 1, 4, 5, 8, 6, 2}, {7, 4, 1, 3, 6, 8, 5, 2}, {2, 5, 8, 6, 3, 1, 4, 7}, {2, 6, 8, 5, 4, 1, 3, 7}};int a[9];voi... 阅读全文

posted @ 2012-07-20 16:54 getgoing 阅读(237) 评论(0) 推荐(0) 编辑

导航