結果

問題 No.714 回転寿司屋のシミュレート
コンテスト
ユーザー letrangerjp
提出日時 2018-07-13 22:49:17
言語 Ruby
(4.0.2)
コンパイル:
ruby -w -c _filename_
実行:
ruby _filename_
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 383 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 61 ms
コンパイル使用メモリ 9,088 KB
実行使用メモリ 14,848 KB
最終ジャッジ日時 2026-04-25 08:19:12
合計ジャッジ時間 3,468 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:9: warning: assigned but unused variable - m
Syntax OK

ソースコード

diff #
raw source code

N = gets.to_i
customers = 20.times.map{[]}

N.times{
  # p customers
  sa = gets.split
  case sa.shift
  when ?0
    n, m, *a = sa
    customers[n.to_i-1] = a
  when ?1
    neta = sa.shift
    p (customers.index{|wish_list|
      idx = wish_list.index(neta)
      idx && wish_list.delete_at(idx)
    } || -2) + 1
  else
    n = sa.shift.to_i
    customers[n - 1] = Array.new
  end
}
0