Use area to get length from groups,don't use the edge

更新了一下取值,以免temp0 与 temp1 一样大时无法取得.采用数组方式获取就不存在这样的问题
The value is updated to avoid that it cannot be obtained when temp0 is as large as temp1. There is no such problem when it is obtained by array