# 根据一个坐标查找其所属区域的一些优化想法

/* 地图M:
+---+---+---+---+---+---+
| A | A | A | A | C | C |
+---+---+---+---+---+---+
| A | B | B | B | C | C |
+---+---+---+---+---+---+
| A | A | B | B | B | C |
+---+---+---+---+---+---+
| A | A | B | B | C | C |
+---+---+---+---+---+---+
| A | A | A | B | C | C |
+---+---+---+---+---+---+
*/

对地图上的每个格子编号之后，可以得到M中各区域拥有的格子数据如下：

/*

*/

/*

*/

/* 区域K真实值:
+---+---+---+---+---+---+
|   |   |   |   |   |   |
+---+---+---+---+---+---+
|   | K | K | K |   |   |
+---+---+---+---+---+---+
|   |   | K | K | K |   |
+---+---+---+---+---+---+
|   |   | K | K |   |   |
+---+---+---+---+---+---+
|   |   |   | K |   |   |
+---+---+---+---+---+---+

区域K粗略的估算值：
+---+---+---+---+---+---+
|   |   |   |   |   |   |
+---+---+---+---+---+---+
|   | K | K | K | * |   |
+---+---+---+---+---+---+
|   | * | K | K | K |   |
+---+---+---+---+---+---+
|   | * | K | K | * |   |
+---+---+---+---+---+---+
|   | * | * | K | * |   |
+---+---+---+---+---+---+
*/

/*

D = { A:(0, 0, 3, 4), B:(1, 1, 4 ,4), C:(4, 0, 5, 4)}
*/

posted @ 2018-01-17 01:46  adinosaur  阅读(215)  评论(0编辑  收藏