結果

問題 No.497 入れ子の箱
ユーザー rpy3cpprpy3cpp
提出日時 2017-03-25 18:52:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 742 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 10,972 KB
実行使用メモリ 8,956 KB
最終ジャッジ日時 2023-09-20 10:46:38
合計ジャッジ時間 39,364 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1,375 ms
8,796 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 992 ms
8,584 KB
testcase_24 AC 1,001 ms
8,696 KB
testcase_25 AC 16 ms
7,848 KB
testcase_26 AC 16 ms
7,784 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def read_data():
    N = int(input())
    xyz = []
    for _ in range(N):
        x, y, z = map(int, input().split())
        xyz.append(x*10**16 + y*10**8 + z)
        xyz.append(x*10**16 + z*10**8 + y)
        xyz.append(y*10**16 + x*10**8 + z)
        xyz.append(y*10**16 + z*10**8 + x)
        xyz.append(z*10**16 + x*10**8 + y)
        xyz.append(z*10**16 + y*10**8 + x)
    return N, xyz

def solve(N, xyz):
    xyz.append(0)
    xyz.sort()
    dp = [0] * (N * 6 + 1)
    for idx, val in enumerate(xyz):
        tmp = 0
        for idx2, val2 in enumerate(xyz[:idx]):
            if val2 < val and tmp < dp[idx2]:
                tmp = dp[idx2]
        dp[idx] = tmp + 1
    return max(dp) - 1

N, xyz = read_data()
print(solve(N, xyz))
0