結果

問題 No.497 入れ子の箱
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-13 01:21:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 5,000 ms
コード長 426 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 81,820 KB
実行使用メモリ 66,440 KB
最終ジャッジ日時 2023-10-20 02:54:02
合計ジャッジ時間 3,320 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,484 KB
testcase_01 AC 40 ms
53,484 KB
testcase_02 AC 37 ms
53,484 KB
testcase_03 AC 57 ms
64,360 KB
testcase_04 AC 57 ms
64,360 KB
testcase_05 AC 57 ms
64,360 KB
testcase_06 AC 57 ms
64,360 KB
testcase_07 AC 58 ms
64,360 KB
testcase_08 AC 57 ms
64,360 KB
testcase_09 AC 57 ms
64,360 KB
testcase_10 AC 57 ms
64,360 KB
testcase_11 AC 57 ms
64,360 KB
testcase_12 AC 68 ms
66,432 KB
testcase_13 AC 69 ms
66,432 KB
testcase_14 AC 67 ms
66,432 KB
testcase_15 AC 68 ms
66,432 KB
testcase_16 AC 68 ms
66,432 KB
testcase_17 AC 66 ms
66,432 KB
testcase_18 AC 63 ms
66,440 KB
testcase_19 AC 62 ms
66,440 KB
testcase_20 AC 60 ms
66,436 KB
testcase_21 AC 62 ms
66,436 KB
testcase_22 AC 62 ms
66,440 KB
testcase_23 AC 50 ms
62,144 KB
testcase_24 AC 49 ms
62,144 KB
testcase_25 AC 36 ms
53,484 KB
testcase_26 AC 35 ms
53,484 KB
testcase_27 AC 62 ms
66,440 KB
testcase_28 AC 63 ms
66,432 KB
testcase_29 AC 66 ms
66,440 KB
testcase_30 AC 57 ms
64,336 KB
testcase_31 AC 63 ms
66,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
box = []
for _ in range(N):
    a, b, c = sorted(map(int, input().split()))
    box.append((a, b, c))
box.sort()

cnt = [1] * N
for i in reversed(range(N)):
    a, b, c = box[i]
    for j in range(i + 1, N):
        p, q, r = box[j]
        if a < p and b < q and c < r:
            cnt[i] = max(cnt[i], cnt[j] + 1)

print(max(cnt))
0