結果

問題 No.497 入れ子の箱
ユーザー H3PO4H3PO4
提出日時 2020-09-02 09:02:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 722 ms / 5,000 ms
コード長 292 bytes
コンパイル時間 497 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-05-01 10:25:52
合計ジャッジ時間 20,609 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 719 ms
10,880 KB
testcase_04 AC 693 ms
10,880 KB
testcase_05 AC 702 ms
10,880 KB
testcase_06 AC 716 ms
11,008 KB
testcase_07 AC 705 ms
10,880 KB
testcase_08 AC 720 ms
10,880 KB
testcase_09 AC 711 ms
11,008 KB
testcase_10 AC 703 ms
10,880 KB
testcase_11 AC 710 ms
10,880 KB
testcase_12 AC 679 ms
10,880 KB
testcase_13 AC 690 ms
11,008 KB
testcase_14 AC 695 ms
10,880 KB
testcase_15 AC 697 ms
10,880 KB
testcase_16 AC 695 ms
10,880 KB
testcase_17 AC 695 ms
11,008 KB
testcase_18 AC 699 ms
10,880 KB
testcase_19 AC 722 ms
11,008 KB
testcase_20 AC 711 ms
10,880 KB
testcase_21 AC 716 ms
10,880 KB
testcase_22 AC 714 ms
11,008 KB
testcase_23 AC 599 ms
10,880 KB
testcase_24 AC 597 ms
11,008 KB
testcase_25 AC 30 ms
10,752 KB
testcase_26 AC 30 ms
10,752 KB
testcase_27 AC 706 ms
10,880 KB
testcase_28 AC 690 ms
10,880 KB
testcase_29 AC 687 ms
10,880 KB
testcase_30 AC 685 ms
10,880 KB
testcase_31 AC 673 ms
11,008 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(max(dp))
0