結果

問題 No.497 入れ子の箱
ユーザー convexineqconvexineq
提出日時 2021-02-17 11:39:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 5,000 ms
コード長 317 bytes
コンパイル時間 843 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 76,932 KB
最終ジャッジ日時 2023-10-11 22:59:19
合計ジャッジ時間 5,425 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,192 KB
testcase_01 AC 75 ms
71,164 KB
testcase_02 AC 74 ms
71,316 KB
testcase_03 AC 101 ms
76,932 KB
testcase_04 AC 102 ms
76,456 KB
testcase_05 AC 104 ms
76,844 KB
testcase_06 AC 105 ms
76,636 KB
testcase_07 AC 104 ms
76,632 KB
testcase_08 AC 103 ms
76,792 KB
testcase_09 AC 101 ms
76,700 KB
testcase_10 AC 99 ms
76,740 KB
testcase_11 AC 101 ms
76,456 KB
testcase_12 AC 115 ms
76,708 KB
testcase_13 AC 115 ms
76,488 KB
testcase_14 AC 115 ms
76,748 KB
testcase_15 AC 114 ms
76,492 KB
testcase_16 AC 113 ms
76,644 KB
testcase_17 AC 116 ms
76,744 KB
testcase_18 AC 111 ms
76,612 KB
testcase_19 AC 111 ms
76,760 KB
testcase_20 AC 112 ms
76,840 KB
testcase_21 AC 111 ms
76,780 KB
testcase_22 AC 112 ms
76,900 KB
testcase_23 AC 100 ms
76,704 KB
testcase_24 AC 99 ms
76,700 KB
testcase_25 AC 73 ms
71,248 KB
testcase_26 AC 75 ms
71,116 KB
testcase_27 AC 114 ms
76,740 KB
testcase_28 AC 115 ms
76,428 KB
testcase_29 AC 110 ms
76,744 KB
testcase_30 AC 100 ms
76,836 KB
testcase_31 AC 103 ms
76,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
xyz = [sorted(map(int,input().split()),reverse=1) for _ in range(n)]
xyz.sort(key=lambda x:x[-1])
dp = [0]*n
for i in range(n):
    c = 0
    xi,yi,zi = xyz[i]
    for j in range(i):
        xj,yj,zj = xyz[j]
        if xi > xj and yi > yj and zi > zj: c = max(c,dp[j])
    dp[i] = c+1
print(max(dp))
0