結果

問題 No.497 入れ子の箱
ユーザー miraxialmiraxial
提出日時 2017-03-24 23:09:46
言語 Ruby
(3.3.0)
結果
AC  
実行時間 184 ms / 5,000 ms
コード長 302 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 11,444 KB
実行使用メモリ 15,312 KB
最終ジャッジ日時 2023-09-20 03:13:00
合計ジャッジ時間 7,213 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,156 KB
testcase_01 AC 82 ms
15,240 KB
testcase_02 AC 82 ms
15,104 KB
testcase_03 AC 184 ms
15,064 KB
testcase_04 AC 181 ms
15,112 KB
testcase_05 AC 180 ms
15,080 KB
testcase_06 AC 180 ms
15,280 KB
testcase_07 AC 179 ms
15,104 KB
testcase_08 AC 179 ms
15,228 KB
testcase_09 AC 184 ms
15,284 KB
testcase_10 AC 183 ms
15,240 KB
testcase_11 AC 180 ms
15,244 KB
testcase_12 AC 154 ms
15,128 KB
testcase_13 AC 154 ms
15,040 KB
testcase_14 AC 155 ms
15,112 KB
testcase_15 AC 156 ms
15,064 KB
testcase_16 AC 155 ms
15,240 KB
testcase_17 AC 155 ms
15,124 KB
testcase_18 AC 175 ms
15,200 KB
testcase_19 AC 175 ms
15,120 KB
testcase_20 AC 175 ms
15,120 KB
testcase_21 AC 175 ms
15,116 KB
testcase_22 AC 175 ms
15,152 KB
testcase_23 AC 126 ms
15,020 KB
testcase_24 AC 130 ms
15,284 KB
testcase_25 AC 83 ms
15,112 KB
testcase_26 AC 83 ms
15,080 KB
testcase_27 AC 158 ms
15,292 KB
testcase_28 AC 159 ms
15,112 KB
testcase_29 AC 159 ms
15,312 KB
testcase_30 AC 146 ms
15,212 KB
testcase_31 AC 146 ms
15,064 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]
  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
    end
  end
  now<< g
end
c=0
now.each do |e|
  c=e[3] if c<e[3]
end
p c+1
0