2012-11-17から1日間の記事一覧

AOJ1160 How Many Islands?

問題リンクRubyで書いてみた。 class IslandCounter attr_accessor :map def initialize(map) @map = map end def neighbors(y, x) w = map[0].length h = map.length neighbor_list =[[y-1, x-1], [y-1, x], [y-1, x+1], [y, x-1], [y, x+1], [y+1, x-1], […