結果

問題 No.497 入れ子の箱
ユーザー yuruhiyayuruhiya
提出日時 2020-09-06 18:50:17
言語 Ruby
(3.3.0)
結果
AC  
実行時間 514 ms / 5,000 ms
コード長 213 bytes
コンパイル時間 466 ms
コンパイル使用メモリ 11,312 KB
実行使用メモリ 15,436 KB
最終ジャッジ日時 2023-08-19 14:14:27
合計ジャッジ時間 15,654 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,072 KB
testcase_01 AC 74 ms
15,084 KB
testcase_02 AC 69 ms
15,084 KB
testcase_03 AC 514 ms
15,272 KB
testcase_04 AC 511 ms
15,200 KB
testcase_05 AC 505 ms
15,240 KB
testcase_06 AC 507 ms
15,340 KB
testcase_07 AC 503 ms
15,312 KB
testcase_08 AC 507 ms
15,364 KB
testcase_09 AC 498 ms
15,388 KB
testcase_10 AC 500 ms
15,140 KB
testcase_11 AC 503 ms
15,364 KB
testcase_12 AC 463 ms
15,364 KB
testcase_13 AC 465 ms
15,244 KB
testcase_14 AC 462 ms
15,124 KB
testcase_15 AC 467 ms
15,136 KB
testcase_16 AC 468 ms
15,252 KB
testcase_17 AC 468 ms
15,332 KB
testcase_18 AC 495 ms
15,240 KB
testcase_19 AC 498 ms
15,264 KB
testcase_20 AC 499 ms
15,312 KB
testcase_21 AC 498 ms
15,428 KB
testcase_22 AC 499 ms
15,136 KB
testcase_23 AC 387 ms
15,328 KB
testcase_24 AC 390 ms
15,208 KB
testcase_25 AC 69 ms
15,224 KB
testcase_26 AC 68 ms
15,236 KB
testcase_27 AC 478 ms
15,236 KB
testcase_28 AC 486 ms
15,128 KB
testcase_29 AC 476 ms
15,248 KB
testcase_30 AC 433 ms
15,436 KB
testcase_31 AC 429 ms
15,236 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
x = (1..n).map { gets.split.map(&:to_i).sort }.sort
dp = [0] * n
puts (0...n).map { |i|
	dp[i] = ((0...i).select { |j|
		x[i].zip(x[j]).all? { |a, b| a > b }
	}.map { |i| dp[i] }.max || 0) + 1
}.max
0