2013年8月3日

UVA 11520 Fill the Square

摘要: 第一篇题解题意:一个n*n的网格里面填了些大写字母,把剩下的也填上,使得相邻的两个网格不相同,并且从左到右,从上到下连起来的字典序最小。直接对每一个没填的网格依次考虑A到Z是否可以。 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 const int maxn = 10 + 5; 9 const int dx[] = {-1, 0, 0, 1};10 const int dy[] = {0, -1, 1, 0};11 char A[maxn][maxn];12 13 14 int ma... 阅读全文

posted @ 2013-08-03 21:23 zhaosdfa 阅读(175) 评论(0) 推荐(0) 编辑

导航