結果

問題 No.497 入れ子の箱
ユーザー tsubametsubame
提出日時 2017-03-25 00:50:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 448 ms / 5,000 ms
コード長 381 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 8,364 KB
最終ジャッジ日時 2023-09-20 07:25:53
合計ジャッジ時間 10,596 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,864 KB
testcase_01 AC 17 ms
7,788 KB
testcase_02 AC 18 ms
7,724 KB
testcase_03 AC 399 ms
8,272 KB
testcase_04 AC 437 ms
8,316 KB
testcase_05 AC 407 ms
8,176 KB
testcase_06 AC 401 ms
8,324 KB
testcase_07 AC 448 ms
8,180 KB
testcase_08 AC 390 ms
8,360 KB
testcase_09 AC 406 ms
8,292 KB
testcase_10 AC 397 ms
8,364 KB
testcase_11 AC 387 ms
8,340 KB
testcase_12 AC 275 ms
8,340 KB
testcase_13 AC 268 ms
8,272 KB
testcase_14 AC 270 ms
8,336 KB
testcase_15 AC 268 ms
8,336 KB
testcase_16 AC 278 ms
8,176 KB
testcase_17 AC 250 ms
8,304 KB
testcase_18 AC 387 ms
8,336 KB
testcase_19 AC 396 ms
8,364 KB
testcase_20 AC 393 ms
8,300 KB
testcase_21 AC 408 ms
8,308 KB
testcase_22 AC 403 ms
8,228 KB
testcase_23 AC 89 ms
8,168 KB
testcase_24 AC 91 ms
8,332 KB
testcase_25 AC 15 ms
7,828 KB
testcase_26 AC 16 ms
7,872 KB
testcase_27 AC 309 ms
8,260 KB
testcase_28 AC 309 ms
8,296 KB
testcase_29 AC 313 ms
8,300 KB
testcase_30 AC 95 ms
8,172 KB
testcase_31 AC 94 ms
8,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
box = []
for i in range(N):
    tmp = list(map(int, input().split()))
    tmp.sort()
    box.append(tmp)

box.sort(key=lambda x:x[2])

score = [1 for i in range(N)]

for i in range(N):
    for j in range(i):
        if box[i][0] > box[j][0] and box[i][1] > box[j][1] and box[i][2] > box[j][2]:
            score[i] = max(score[j] + 1, score[i])

print(max(score))
0