動画の切り出し

ffmpeg を使う。

開始5分の時点から1分間切り出す。ついでに mkv から mp4 へ変換。時間指定は「hh:mm:ss」という形式でも OK。

$ ffmpeg -ss 300 -i a.mkv -t 60 a1.mp4

「-ss」が前に来るようにする。

動画の連結はこちら


※参考
FFmpegで素早く正確に動画をカットする自分的ベストプラクティス - Qiita
それFFmpegで出来るよ! - Qiita
Ffmpegで複数動画ファイルを無劣化で結合したり、無劣化で切り出したりする | Creazy!

CPSCO2019 Session4

CPSCO2019 Session4 - AtCoder

A - Swimming

l, x = gets.split.map(&:to_i)
n = x / l
puts n.even? ? x % l : (n + 1) * l - x

 

B - Meeting

n, d = gets.split.map(&:to_i)
table = d.times.map do
  gets.chomp.chars.map.with_index {|st, i| i if st == "o"}.compact
end
puts table.combination(2).map {|d1, d2| (d1 + d2).uniq.size}.max

 

C - Make a Team

def c(a)
  return 1 if a == 1
  a * (a - 1) / 2
end

n, d = gets.split.map(&:to_i)
r = gets.split.map(&:to_i).sort.push(Float::INFINITY)
count = 0
(n - 2).times do |i|
  idx = r[i + 2..-1].bsearch_index {|r0| r0 - r[i] > d}
  next if !idx or idx.zero?
  count += c(idx + 1)
end
puts count

rindex を使ったら TLE だったので、bsearch_index に切り替えた。

Ruby 2.6 で Gem 'chipmunk' を使う(Ubuntu)

Ubuntu 19.04 の Ruby 2.6 で Gem 'chipmunk' がインストールできない。

解決策:GitHub で修正されているものを使う。

$ git clone https://github.com/chipmunk-rb/chipmunk.git
$ cd chipmunk
$ rake clean compile
$ gem build chipmunk.gemspec
  Successfully built RubyGem
  Name: chipmunk
  Version: 6.1.3.4
  File: chipmunk-6.1.3.4.gem
$ cd ..

 
Gemfile に以下を追加(参照)。

gem 'chipmunk', :path => "chipmunk"

 
インストール。

$ bundle install
$ bundle exec pry
[1] pry(main)> require 'chipmunk'
=> true

これで OK。

AOJ(問題集)20

AIZU ONLINE JUDGE: Programming Challenge
 

0190 Eleven Puzzle

素直に幅優先探索を実行して死んだので、ここを参考に解いた。「両側探索」というらしい。

start = "fff0fff" "ff123ff" "f45678f" "ff9abff" "fff0fff"
result1 = {}
result1[start] = 0
stack = [start]

# 一方からの探索
while (nxt = stack.shift)
  next if result1[nxt] >= 10
  doit1 = ->(idx) {
    [1, -1, 7, -7].each do |di|
      next_index = idx + di
      next if next_index < 0 or next_index >= 35
      next if (c = nxt[next_index]) == "f" or c == "0"
      next_field = nxt.dup
      next_field[idx] = c
      next_field[next_index] = "0"
      next if result1[next_field]
      result1[next_field] = result1[nxt] + 1
      stack << next_field
    end
  }
  doit1.(nxt.index("0"))
  doit1.(nxt.rindex("0"))
end

# 反対側からの探索
pat = Array.new(5)
until (pat[0] = gets.to_i) == -1
  pat[0] = pat[0].to_s(16).center(7, "f")
  4.times {|i| pat[i + 1] = gets.split.map {|a| a.to_i.to_s(16)}.join.center(7, "f") }
  
  if (ans = result1[start = pat.join])
    puts ans
    next
  end
  
  result2 = {}
  result2[start] = 0
  stack = [start]
  str = "NA"
  f = true
  
  while (nxt = stack.shift) and f
    next if result2[nxt] >= 10
    doit2 = ->(idx) {
      [1, -1, 7, -7].each do |di|
        next_index = idx + di
        next if next_index < 0 or next_index >= 35
        next if (c = nxt[next_index]) == "f" or c == "0"
        next_field = nxt.dup
        next_field[idx] = c
        next_field[next_index] = "0"
        next if result2[next_field]
        if result1[next_field]
          str = (result1[next_field] + result2[nxt] + 1).to_s
          return false
        end
        result2[next_field] = result2[nxt] + 1
        stack << next_field
      end
      true
    }
    f = doit2.(nxt.index("0"))
    f = doit2.(nxt.rindex("0")) if f
  end
  puts str
end

 

0191 Baby Tree

until (given = gets.split.map(&:to_i)) == [0, 0]
  n, m = given
  g = n.times.map {gets.split.map(&:to_f)}
  memo = Array.new(101) {Array.new(101)}
  
  compost = ->(num, left) {
    return memo[num][left] if memo[num][left]
    memo[num][left] = if left.zero?
      1.0
    else
      n.times.map {|j| g[num][j] * compost.(j, left - 1)}.max
    end
  }
  printf "%.02f\n", n.times.map {|i| compost.(i, m - 1)}.max.round(2)
end

アホなミスをしていた。メモ化で値が存在するときに return を忘れているという…(笑)
 

0192 Multistory Parking Lot

class Car
  num = 1
  
  define_method(:initialize) do |waiting_time|
    @num = num
    num += 1
    @time = waiting_time
  end
  attr_accessor :num, :time
  
  define_singleton_method(:clear) {num = 1}
end

class ParkingLot
  Space = Struct.new(:upper, :lower)
  
  def initialize(num)
    @spaces = num.times.map {|i| Space.new}
  end
  
  def add_car(waiting_time)
    idx = @spaces.index {|sp| sp.lower.nil?}
    if idx
      @spaces[idx].lower = Car.new(waiting_time)   #下のスペースが空いている
    else
      return false if @spaces.all?(&:upper)        #満車
      
      #下は空いていないが満車でない場合
      idxs = @spaces.map.with_index {|sp, i| i unless sp.upper}.compact
      idx = idxs.map do |i|
        diff = @spaces[i].lower.time - waiting_time
        diff >= 0 ? [diff, i] : nil
      end.compact.sort.first&.last
      unless idx
        idx = idxs.map {|i| [waiting_time - @spaces[i].lower.time, i]}.sort.first.last
      end
      
      @spaces[idx].upper = @spaces[idx].lower.dup
      @spaces[idx].lower = Car.new(waiting_time)
    end
    true
  end
  
  def next
    @spaces.each do |sp|
      if sp.lower
        sp.lower.time -= 1
        sp.upper.time -= 1 if sp.upper
      end
    end
    
    out = []
    2.times do
      @spaces.each do |sp|
        if sp.lower and sp.lower.time <= 0
          out << sp.lower.num
          sp.lower = sp.upper.dup
          sp.upper = nil
        end
      end
    end
    
    out
  end
  
  #車庫が空か
  def empty?
    @spaces.all? {|sp| sp.lower.nil?}
  end
end


until (given = gets.split.map(&:to_i)) == [0, 0]
  m, n = given
  parking_time = n.times.map {gets.to_i}
  pl = ParkingLot.new(m)
  result = []
  wait = []
  Car.clear
  t = 0
  
  loop do
    result += pl.next
    
    wait << parking_time.shift if (t % 10).zero?
    t += 1
    while (wait_time = wait.shift)
      unless pl.add_car(wait_time)
        wait.unshift(wait_time)    #満車の場合
        break
      end
    end
    
    break if pl.empty?
  end
  
  puts result.join(" ")
end

だいぶ勘違いをしていた。Ruby では三人しか出来ていないですよ。

AtCoder(AtCoder Beginners Selection)

AtCoder Beginners Selection - AtCoder
 

PracticeA - はじめてのあっとこーだー(Welcome to AtCoder

a = gets.to_i
b, c = gets.split.map(&:to_i)
s = gets
 
print "#{a + b + c} #{s}"

 

ABC086A - Product

a, b = gets.split.map(&:to_i)
puts (a * b).odd? ? "Odd" : "Even"

 

ABC081A - Placing Marbles

puts gets.chomp.count("1")

 

ABC081B - Shift only

def calc(ary, co)
  return co unless ary.all?(&:even?)
  calc(ary.map {|i| i / 2}, co + 1)
end

gets
given = gets.split.map(&:to_i)
puts calc(given, 0)

 

ABC087B - Coins

table = [500, 100, 50]
coins = 3.times.map {gets.to_i}
x = gets.to_i
memo = Array.new(4) {[]}

try = ->(i, yen) {
  return memo[i][yen] if memo[i][yen]
  return 1 if yen.zero?
  return 0 if i >= 3
  co = 0
  (0..coins[i]).each do |n|
    yen1 = yen - table[i] * n
    break if yen1 < 0
    co += try.(i + 1, yen1)
  end
  memo[i][yen] = co
}
puts try.(0, x)

 

ABC083B - Some Sums

n, a, b = gets.split.map(&:to_i)
puts (1..n).select {|i| i.to_s.bytes.map {|b| b - 48}.inject(&:+).between?(a, b)}
           .inject(&:+)

 

ABC088B - Card Game for Two

n = io.gets.to_i
cards = io.gets.split.map(&:to_i).sort
diff = 0

(0...n).each do |i|
  if i.even?
    diff += cards[n - 1 - i]
  else
    diff -= cards[n - 1 - i]
  end
end
puts diff

 

ABC085B - Kagami Mochi

n = gets.to_i
puts n.times.map {gets.to_i}.uniq.size

 

ABC085C - Otoshidama

n, y = gets.split.map(&:to_i)

limit1 = [y / 10000, n].min
(0..limit1).each do |b1|
  yen1 = y - 10000 * b1
  limit2 = [yen1 / 5000, n - b1].min
  (0..limit2).each do |b2|
    b3 = n - b1 - b2
    if yen1 == 5000 * b2 + 1000 * b3
      puts "#{b1} #{b2} #{b3}"
      exit
    end
  end
end
puts "-1 -1 -1"

これで 0.216秒。
よりよい方法がよく考えたらわかった。

n, y = gets.split.map(&:to_i)

limit1 = [y / 10000, n].min
(0..limit1).each do |b1|
  x = y / 1000 - n - 9 * b1
  if x >= 0 and (x % 4).zero?
    b2 = x / 4
    b3 = n - b1 - b2
    if b3 >= 0 and 10000 * b1 + 5000 * b2 + 1000 * b3 == y
      puts "#{b1} #{b2} #{b3}"
      exit
    end
  end
end
puts "-1 -1 -1"

これで 0.009秒。
 

ABC049C - 白昼夢 / Daydream

table = %w(dream dreamer erase eraser).map(&:reverse)
s = gets.chomp.reverse
result = "YES"

until s.length.zero?
  catch :jump do
    table.each do |word|
      n = word.length
      if s[0, n] == word
        s = s[n..-1]
        throw :jump
      end
    end
    result = "NO"
    s = ""
  end
end
puts result

 

ABC086C - Traveling

n = gets.to_i
plans = n.times.map {gets.split.map(&:to_i)}

f = plans.all? do |t, x, y|
  d = x.abs + y.abs
  if t < d
    false
  else
    t.odd? ? d.odd? : d.even?
  end
end
puts f ? "Yes" : "No"

AOJ(問題集)19

AIZU ONLINE JUDGE: Programming Challenge
 

0180 Demolition of Bridges

until (given = $<.gets.split.map(&:to_i)) == [0, 0]
  n, m = given
  bridges = m.times.map {$<.gets.split.map(&:to_i)}.sort_by(&:last)
  city = Array.new(n, false)
  city[0] = true
  appearance = 1
  total_cost = 0
  
  while appearance < n
    bridges.each_index do |i|
      a, b, cost = bridges[i]
      if city[a] or city[b]
        if !city[a]
          city[a] = true
          appearance += 1
          total_cost += cost
        elsif !city[b]
          city[b] = true
          appearance += 1
          total_cost += cost
        end
        bridges.delete_at(i)
        break
      end
    end
  end
  
  puts total_cost
end

「0072 Carden Lantern」とほぼ同じ問題(最小全域木を求める)。ここで使ったのは「プリム法」というらしい。
 

0181 Bookshelf

Limit = 1500000

until (given = $<.gets.split.map(&:to_i)) == [0, 0]
  m, n = given
  book = n.times.map {$<.gets.to_i}
  narrowest = Limit
  pool = []
  
  try = ->(from, h, pool) {
    return if !pool.empty? and pool.last > narrowest
    if h > m
      if from == n
        a = pool.max
        narrowest = a if a < narrowest
      end
    else
      width = 0
      (from...n).each do |i|
        width += book[i]
        try.(i + 1, h + 1, pool + [width])
      end
      if narrowest == Limit
        a = pool.max
        narrowest = a if a < narrowest
      end
    end
  }
  try.(0, 1, [])
  puts narrowest
end

7.73秒で時間オーバー。

until (given = $<.gets.split.map(&:to_i)) == [0, 0]
  m, n = given
  books = n.times.map {$<.gets.to_i}
  smallest = 1500000
  m = n if n < m
  
  if m == 1
    puts books.sum
    next
  end
  
  [*1..n - 1].combination(m - 1) do |sep|
    i = 0
    shelf = []
    sep.each do |j|
      shelf << books[i...j]
      i = j
    end
    shelf << books[i..-1]
    
    len = shelf.map {|a| a.sum}.max
    smallest = len if len < smallest
  end
  puts smallest
end

10秒で時間オーバー。
他の人の回答を見る。

Limit = 1500000

until (given = $<.gets.split.map(&:to_i)) == [0, 0]
  m, n = given
  books = n.times.map {$<.gets.to_i}
  memo = Array.new(m + 1) {[]}
  
  shelf = ->(h, from) {
    return 0 if from >= n
    return memo[h][from] if memo[h][from]
    
    if h == 1
      width = books[from...n].sum
      return memo[h][from] = width
    end
    
    narrowest = Limit
    width = 0
    to = n - h + 1
    
    (from..to).each do |i|
       width1 = shelf.(h - 1, i)
       wider = [width, width1].max
       narrowest = wider if narrowest > wider
       
       width += books[i]
       break if narrowest <= width
    end
    memo[h][from] = narrowest
  }
  
  puts shelf.(m, 0)
end

0.06秒ですよ。すごいなあ。
いやこれ、2分探索の典型的な問題なのだった。

Limit = 1500000

until (given = $<.gets.split.map(&:to_i)) == [0, 0]
  m, n = given
  books = n.times.map {$<.gets.to_i}
  
  f = ->(width) {
    need = 1
    sum = 0
    books.each do |book|
      return false if book > width
      sum += book
      if sum > width
        need += 1
        sum = book
      end
    end
    need <= m    
  }
  
  l = 1
  r = Limit
  
  while l <= r
    mid = l + (r - l) / 2
    if !f.(mid)
      l = mid + 1
    else
      r = mid - 1
    end
  end
  puts l
end

0.04秒で正解なのだが、バグって死んだ。「まめめも」参照。2分探索超むづかしい。
Ruby の組み込みメソッドを使ってみた。

Limit = 1500000

until (given = $<.gets.split.map(&:to_i)) == [0, 0]
  m, n = given
  books = n.times.map {$<.gets.to_i}
  
  f = ->(width) {
    need = 1
    sum = 0
    books.each do |book|
      return false if book > width
      sum += book
      if sum > width
        need += 1
        sum = book
      end
    end
    need <= m    
  }
  puts (1..Limit).bsearch {|width| f.(width)}
end

 

0183 Black-and-White

loop do
  board = Array.new(3)
  break if (board[0] = $<.gets.chomp) == "0"
  board[1] = $<.gets.chomp
  board[2] = $<.gets.chomp
  
  check = ->(c) {
    gl = c * 3
    return true if board.map {|b| b == gl}.any?
    return true if 3.times.map {|i| board.map {|b| b[i]}.join == gl }.any?
    return true if board[0][0] + board[1][1] + board[2][2] == gl 
    return true if board[0][2] + board[1][1] + board[2][0] == gl
    false
  }
  str = case
        when check.("b") then "b"
        when check.("w") then "w"
        else "NA"
        end
  puts str
end

 

0184 Tsuruga Castle

table = 6.times.map {|i| [i * 10, (i + 1) * 10 - 1]} + [[60, 120]]

until (n = $<.gets.to_i).zero?
  count = Array.new(7, 0)
  n.times.map {$<.gets.to_i}.each do |age|
    idx = table.index {|a, b| age.between?(a, b)}
    count[idx] += 1
  end
  puts count
end

 

0185 Goldbach's Conjecture II

N = 1000000

sieve = [*0..N]
2.upto(Math.sqrt(N).to_i) do |i|
  next if sieve[i].zero?
  2.upto(N / i) {|j| sieve[i * j] = 0}
end
sieve = sieve[2..-1].reject {|x| x.zero?}

def prime?(n)
  return false if n < 2
  return true  if n == 2 or n == 3
  return false if (n % 2).zero? or (n % 3).zero?
  i, step = 5, 2
  guard = Math.sqrt(n).to_i
  while i <= guard
    return false if (n % i).zero?
    i += step
    step = 6 - step
  end
  true
end

until (n = $<.gets.to_i).zero?
  co = 0
  i = 0
  loop do
    a = sieve[i]
    break if a > n / 2
    co += 1 if prime?(n - a)
    i += 1
  end
  puts co
end

1.49秒かかった。標準添付ライブラリの Prime クラスを使うより高速な素数判定をしている。
さらに高速に。うまくエラトステネスの篩を使えばもっと速い。

N = 1000000

sieve = Array.new(N + 1, 0)
2.upto(Math.sqrt(N).to_i) do |i|
  next if sieve[i].nonzero?
  2.upto(N / i) {|j| sieve[i * j] = 1}
end

num = (2..N).select {|i| sieve[i].zero?}

until (n = $<.gets.to_i).zero?
  co = 0
  num.each do |a|
    b = n - a
    break if a > b
    co += 1 if sieve[b].zero?
  end
  puts co
end

これで 0.26秒。
 

0186 Aizu Chicken

until (given = $<.gets.split.map(&:to_i)) == [0]
  q1, b, c1, c2, q2 = given
  limit = [q2, b / c1].min
  str = "NA"
  limit.downto(1) do |aizu|
     tori = (b - aizu * c1) / c2
     if tori >= 0 and aizu + tori >= q1
       str = "#{aizu} #{tori}"
       break
     end
  end
  puts str
end

これ、簡単そうなのにわからなかった。ここを参考にした。
 

0187 Stoning Fortune

require 'matrix'

def cross(x1, y1, x2, y2, x3, y3, x4, y4)
  a = Matrix[[x2 - x1, x3 - x4], [y2 - y1, y3 - y4]].lup.solve([x3 - x1, y3 - y1]) rescue nil
  return false unless a
  s, t = a[0], a[1]
  f = ((0 <= s and s <= 1) and (0 <= t and t <= 1))
  f ? Vector[x1 + s * (x2 - x1), y1 + s * (y2 - y1)] : false
end

until (given = $<.gets.split.map(&:to_i)) == [0] * 4
  x, y = [], []
  x[0], y[0], x[1], y[1] = given
  x[2], y[2], x[3], y[3] = $<.gets.split.map(&:to_i)
  x[4], y[4], x[5], y[5] = $<.gets.split.map(&:to_i)
  p1 = cross(x[0], y[0], x[1], y[1], x[2], y[2], x[3], y[3]) 
  p2 = cross(x[2], y[2], x[3], y[3], x[4], y[4], x[5], y[5]) 
  p3 = cross(x[4], y[4], x[5], y[5], x[0], y[0], x[1], y[1])
  str = "kyo"
  if p1 and p2 and p3
    v1 = p2 - p1
    v2 = p3 - p1
    s = Rational((v1[0] * v2[1] - v1[1] * v2[0]).abs, 2)
    if s.nonzero?
      idx = nil
      [Float::INFINITY, 1_900_000, 1_000_000, 100_000, 0].each_cons(2).with_index do |a, i|
        idx = i if a[1] <= s and s < a[0]
      end
      str = %w(dai-kichi chu-kichi kichi syo-kichi)[idx]
    end
  end
  puts str
end

つまらぬバグを取るのが大変だった。f = true and falsefalse なのだけれど、f = true になるのか。
 

0188 Search

until (n = $<.gets.to_i).zero?
  a = n.times.map {$<.gets.to_i}
  k = $<.gets.to_i
  co = 0
  
  f = ->(from, to) {
    return co if from > to
    mid = (from + to) / 2
    co += 1
    return co if a[mid] == k
    (a[mid] < k) ? f.(mid + 1, to) : f.(from, mid - 1)
  }
  puts f.(0, n - 1)
end

2分探索はどうもよくわからない。
 

0189 Convenient Location

until (n = $<.gets.to_i).zero?
  e = n.times.map {$<.gets.split.map(&:to_i)}
  edges = (e.map {|a, b, c| [[a, b], c]} + e.map {|a, b, c| [[b, a], c]}).to_h
  h = Hash.new([])
  edges.keys.each {|a, b| h[a] += [b]}
  
  try = ->(start) {
    shortest = Hash.new(Float::INFINITY)
    done = h.keys.map {|k| [k, false]}.to_h
    shortest[start] = 0
    
    loop do
      u = nil
      h.each_key do |node|
        next if done[node]
        u = node if !u or shortest[node] < shortest[u]
      end
      break unless u
      done[u] = true
      
      h[u].each do |v|
        if (a = shortest[u] + edges[[u, v]]) < shortest[v]
          shortest[v] = a
        end
      end
    end
    
    shortest.values.sum
  }
  puts h.keys.map {|k| [try.(k), k]}.sort.first.reverse.join(" ")
end

ダイクストラ法。

AOJ(ALDS)その2

AIZU ONLINE JUDGE: Programming Challenge
 

ALDS1_9_A Complete Binary Tree

#完全二分木
$<.gets
given = [nil] + $<.gets.split.map(&:to_i)
a = nil
 
given.drop(1).each_with_index do |key, i|
  j = i + 1
  str = "node #{j}: key = #{key}, "
  str += "parent key = #{a}, " if (a = given[j / 2])
  str += "left key = #{a}, "   if (a = given[j * 2])
  str += "right key = #{a}, "  if (a = given[j * 2 + 1])
  puts str
end

 

ALDS1_9_B Maximum Heap

#最大ヒープ
h = $<.gets.to_i
given = [nil] + $<.gets.split.map(&:to_i)
 
max_heapify = ->(i) {
  l, r = i * 2, i * 2 + 1
  largest = (l <= h and given[l] > given[i]) ? l : i
  largest = r if r <= h and given[r] > given[largest]
  unless largest == i
    given[i], given[largest] = given[largest], given[i]
    max_heapify.(largest)
  end
}
 
(h / 2).downto(1) {|i| max_heapify.(i)}
puts given.drop(1).map {|i| " #{i}"}.join

 

ALDS1_9_C Priority Queue

#優先度付きキュー
class MaxHeap
  def initialize
    @heap = [nil]
    @size = 0
  end
   
  def insert(key)
    @heap << key
    @size += 1
    up_heap(@size / 2)
  end
   
  def up_heap(i)
    return if i.zero?
    l, r = i * 2, i * 2 + 1
    largest = (l <= @size and @heap[l] > @heap[i]) ? l : i
    largest = r if r <= @size and @heap[r] > @heap[largest]
    unless largest == i
      @heap[i], @heap[largest] = @heap[largest], @heap[i]
      up_heap(i / 2)
    end
  end
   
  def remove_root
    a = @heap[1]
    @heap[1] = @heap.pop
    @size -= 1
    down_heap(1)
    a
  end
   
  def down_heap(i)
    return if i > @size
    l, r = i * 2, i * 2 + 1
    largest = (l <= @size and @heap[l] > @heap[i]) ? l : i
    largest = r if r <= @size and @heap[r] > @heap[largest]
    unless largest == i
      @heap[i], @heap[largest] = @heap[largest], @heap[i]
      down_heap(largest)
    end
  end
end
 
 
h = MaxHeap.new
 
$<.readlines.map {|l| l.chomp.split}.each do |command|
  case command[0]
  when "insert" then h.insert(command[1].to_i)
  when "extract" then puts h.remove_root
  when "end" then break
  else raise "error"
  end
end

 

ALDS1_10_A Fibonacci Number

#フィボナッチ数列
fib = Enumerator.new do |y|
  a, b = 1, 1
  loop do
    y << a
    a, b = b, a + b
  end
end
 
puts fib.take($<.gets.to_i + 1).last

Ruby/Opal サンプル


コード。Ruby 部分のみ。

require 'native'

d = Native(`document`)
area = d.getElementById("text")
button = d.getElementById("start")
interval = Native(`window.setInterval`)

z, d = zd = ["ズン", "ドコ"]
st = ""
line = []
f = false

zundoko = ->{
  return if f
  line << zd[rand(2)]
  line = line.last(5)
  st += line.last
  area.textContent = st
  if line == [z, z, z, z, d]
    area.textContent = st + " キ・ヨ・シ!"
    f = true
  end
}

start = ->{interval.call(zundoko, 1000)}
button.addEventListener("click", start)