結果

問題 No.497 入れ子の箱
ユーザー H3PO4H3PO4
提出日時 2020-09-02 08:57:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 291 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-05-01 10:25:31
合計ジャッジ時間 18,246 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,624 KB
testcase_01 AC 28 ms
10,752 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 644 ms
10,880 KB
testcase_04 AC 634 ms
10,880 KB
testcase_05 AC 631 ms
10,880 KB
testcase_06 AC 629 ms
10,752 KB
testcase_07 AC 637 ms
10,752 KB
testcase_08 AC 637 ms
11,008 KB
testcase_09 AC 655 ms
10,752 KB
testcase_10 AC 637 ms
10,752 KB
testcase_11 AC 647 ms
10,752 KB
testcase_12 AC 607 ms
10,880 KB
testcase_13 AC 615 ms
10,880 KB
testcase_14 AC 620 ms
10,752 KB
testcase_15 WA -
testcase_16 AC 634 ms
10,752 KB
testcase_17 AC 640 ms
10,752 KB
testcase_18 AC 674 ms
10,752 KB
testcase_19 AC 669 ms
10,752 KB
testcase_20 AC 622 ms
10,880 KB
testcase_21 AC 626 ms
10,752 KB
testcase_22 AC 616 ms
10,752 KB
testcase_23 AC 529 ms
10,624 KB
testcase_24 AC 534 ms
10,880 KB
testcase_25 AC 25 ms
10,880 KB
testcase_26 AC 26 ms
10,624 KB
testcase_27 AC 608 ms
10,880 KB
testcase_28 AC 633 ms
10,752 KB
testcase_29 AC 609 ms
10,752 KB
testcase_30 AC 602 ms
10,752 KB
testcase_31 AC 605 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
Boxes = []
for _ in range(N):
    Boxes.append(sorted(list(map(int, input().split()))))
Boxes.sort()

dp = [1] * N
for i in range(N):
    for j in range(i):
        if all(Boxes[i][x] > Boxes[j][x] for x in range(3)):
            dp[i] = max(dp[i], dp[j] + 1)
print(dp[-1])
0