結果

問題 No.497 入れ子の箱
ユーザー smz_8110smz_8110
提出日時 2017-04-07 10:53:21
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 39 ms
コンパイル使用メモリ 11,248 KB
実行使用メモリ 16,748 KB
最終ジャッジ日時 2023-09-22 23:51:36
合計ジャッジ時間 8,828 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,088 KB
testcase_01 AC 80 ms
15,280 KB
testcase_02 AC 80 ms
15,264 KB
testcase_03 AC 289 ms
16,748 KB
testcase_04 AC 288 ms
16,456 KB
testcase_05 AC 288 ms
16,536 KB
testcase_06 AC 288 ms
16,536 KB
testcase_07 AC 296 ms
16,652 KB
testcase_08 AC 286 ms
16,728 KB
testcase_09 AC 289 ms
16,476 KB
testcase_10 AC 287 ms
16,604 KB
testcase_11 AC 289 ms
16,484 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 127 ms
15,136 KB
testcase_24 AC 128 ms
15,236 KB
testcase_25 AC 80 ms
15,016 KB
testcase_26 AC 80 ms
15,092 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 147 ms
15,448 KB
testcase_31 AC 149 ms
15,276 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a=gets.to_i.times.map{gets.split.map(&:to_i).sort}.sort{|a,b|b.inject(:*)<=>a.inject(:*)}
F=->a,i,l,c,m{
  return m[i] if m[i]
  return c if i>=a.size
  r=c
  (i...a.size).each{|j|
    v=a[j]
    if v[0]<l[0]&&v[1]<l[1]&&v[2]<l[2]
      q=F[a,j+1,v,c+1,m]
      r=q if q>r
    end
  }
  m[i]=r
}
p F[a,0,[10**8,10**8,10**8],0,{}]
0