is_ending()
map
mat
faster