結果

問題 No.497 入れ子の箱
ユーザー cielciel
提出日時 2017-04-24 00:47:03
言語 Ruby
(3.3.0)
結果
AC  
実行時間 427 ms / 5,000 ms
コード長 179 bytes
コンパイル時間 546 ms
コンパイル使用メモリ 11,228 KB
実行使用メモリ 15,492 KB
最終ジャッジ日時 2023-09-29 16:17:46
合計ジャッジ時間 14,429 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,324 KB
testcase_01 AC 78 ms
15,156 KB
testcase_02 AC 79 ms
15,052 KB
testcase_03 AC 423 ms
15,224 KB
testcase_04 AC 421 ms
15,272 KB
testcase_05 AC 423 ms
15,364 KB
testcase_06 AC 420 ms
15,180 KB
testcase_07 AC 421 ms
15,388 KB
testcase_08 AC 420 ms
15,260 KB
testcase_09 AC 423 ms
15,232 KB
testcase_10 AC 419 ms
15,324 KB
testcase_11 AC 418 ms
15,296 KB
testcase_12 AC 427 ms
15,204 KB
testcase_13 AC 420 ms
15,184 KB
testcase_14 AC 426 ms
15,292 KB
testcase_15 AC 423 ms
15,380 KB
testcase_16 AC 427 ms
15,256 KB
testcase_17 AC 423 ms
15,416 KB
testcase_18 AC 424 ms
15,260 KB
testcase_19 AC 420 ms
15,220 KB
testcase_20 AC 421 ms
15,208 KB
testcase_21 AC 422 ms
15,492 KB
testcase_22 AC 422 ms
15,296 KB
testcase_23 AC 338 ms
15,416 KB
testcase_24 AC 338 ms
15,264 KB
testcase_25 AC 78 ms
15,040 KB
testcase_26 AC 78 ms
15,176 KB
testcase_27 AC 422 ms
15,276 KB
testcase_28 AC 420 ms
15,276 KB
testcase_29 AC 425 ms
15,192 KB
testcase_30 AC 423 ms
15,280 KB
testcase_31 AC 424 ms
15,420 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
a=n.times.map{gets.split.map(&:to_i).sort}.sort
d=[]
n.times{|i|
	d[i]=1
	i.times{|j|
		if (0..2).all?{|x|a[j][x]<a[i][x]}
			d[i]=[d[j]+1,d[i]].max
		end
	}
}
p d.max
0