結果

問題 No.497 入れ子の箱
ユーザー miraxialmiraxial
提出日時 2017-03-24 23:04:04
言語 Ruby
(3.2.2)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 40 ms
コンパイル使用メモリ 11,544 KB
実行使用メモリ 15,376 KB
最終ジャッジ日時 2023-09-20 02:51:02
合計ジャッジ時間 4,201 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,272 KB
testcase_01 AC 80 ms
15,116 KB
testcase_02 AC 79 ms
15,128 KB
testcase_03 AC 83 ms
15,112 KB
testcase_04 AC 84 ms
15,300 KB
testcase_05 AC 84 ms
15,016 KB
testcase_06 AC 88 ms
15,028 KB
testcase_07 AC 85 ms
15,148 KB
testcase_08 AC 84 ms
15,180 KB
testcase_09 AC 83 ms
15,124 KB
testcase_10 AC 84 ms
15,080 KB
testcase_11 AC 84 ms
15,156 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 124 ms
15,020 KB
testcase_24 AC 123 ms
15,132 KB
testcase_25 AC 79 ms
15,148 KB
testcase_26 AC 79 ms
15,152 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 143 ms
15,116 KB
testcase_31 AC 142 ms
15,136 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,*a=$<.map{|e|e.split.map(&:to_i).sort}
a.sort!{|x,y|x[0]<=>y[0]}
now=[]
n[0].times do |i|
  g=a[i]+[0]
  r=[]
  now.length.times do |j|
    gg=now[j]
    if gg[0]<g[0] && gg[1]<g[1] && gg[2]<g[2]
      g[3]=gg[3]+1 if g[3]<gg[3]+1
      r<< j
    end
  end
  r.length.times do |j|
    now.delete_at(r[j]-j)
  end
  now<< g
end
c=0
now.each do |e|
  c=e[3] if c<e[3]
end
p c+1
0