2008-10-15から1日間の記事一覧
標準でないのかな??? なのでpythonから引っ張ってくる。 Arrayに突っ込む。 class Array def heappush(item) self.push(item) siftdown(0, self.length - 1) end def heappop lastelt = self.pop() if self.length > 0 returnitem = self[0] self[0] = la…
pythonから引っ張ってくる class Array def insert_right(item, lo=0, hi=nil) if lo < 0 raise IndexError.new('lo must be non-negative') end if hi == nil hi = self.length end while lo < hi mid = ((lo+hi)/2).truncate if item < self[mid] hi = mid…
わんくま同盟 ミスター富山県民ことid:yone098が出ないなんておかしいぞ!?