結果

問題 No.714 回転寿司屋のシミュレート
ユーザー letrangerjp
提出日時 2018-07-13 22:49:17
言語 Ruby
(3.4.1)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-10-09 05:26:46
合計ジャッジ時間 4,576 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:9: warning: assigned but unused variable - m
Syntax OK

ソースコード

diff #

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