結果

問題 No.497 入れ子の箱
ユーザー roarisroaris
提出日時 2020-12-05 16:14:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 368 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 86,676 KB
実行使用メモリ 76,488 KB
最終ジャッジ日時 2023-10-13 22:14:03
合計ジャッジ時間 5,308 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,036 KB
testcase_01 AC 75 ms
71,044 KB
testcase_02 AC 76 ms
70,940 KB
testcase_03 AC 92 ms
76,488 KB
testcase_04 AC 106 ms
76,456 KB
testcase_05 AC 100 ms
76,400 KB
testcase_06 AC 102 ms
76,260 KB
testcase_07 AC 103 ms
76,324 KB
testcase_08 AC 103 ms
76,064 KB
testcase_09 AC 100 ms
76,220 KB
testcase_10 AC 96 ms
76,256 KB
testcase_11 AC 96 ms
76,300 KB
testcase_12 AC 116 ms
76,372 KB
testcase_13 AC 115 ms
76,260 KB
testcase_14 AC 119 ms
76,472 KB
testcase_15 AC 115 ms
76,120 KB
testcase_16 AC 115 ms
76,272 KB
testcase_17 AC 119 ms
76,344 KB
testcase_18 AC 113 ms
76,120 KB
testcase_19 AC 104 ms
76,284 KB
testcase_20 AC 106 ms
76,100 KB
testcase_21 AC 102 ms
76,132 KB
testcase_22 AC 102 ms
76,424 KB
testcase_23 AC 86 ms
76,312 KB
testcase_24 AC 89 ms
76,244 KB
testcase_25 AC 72 ms
71,024 KB
testcase_26 AC 73 ms
71,020 KB
testcase_27 AC 109 ms
76,100 KB
testcase_28 AC 105 ms
76,260 KB
testcase_29 AC 105 ms
76,420 KB
testcase_30 AC 95 ms
76,420 KB
testcase_31 AC 102 ms
76,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def ok(a, b):
    return a[0]<b[0] and a[1]<b[1] and a[2]<b[2]

N = int(input())
XYZ = [list(map(int, input().split())) for _ in range(N)]

for i in range(N):
    XYZ[i].sort()

XYZ.sort()
dp = [1]*N

for i in range(N):
    for j in range(i):
        if ok(XYZ[j], XYZ[i]):
            dp[i] = max(dp[i], dp[j]+1)

print(max(dp))
0