結果

問題 No.497 入れ子の箱
ユーザー tsubametsubame
提出日時 2017-03-25 00:42:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 495 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 8,432 KB
最終ジャッジ日時 2023-09-20 07:22:54
合計ジャッジ時間 2,156 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 17 ms
7,812 KB
testcase_02 AC 16 ms
7,828 KB
testcase_03 WA -
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 50 ms
8,240 KB
testcase_24 AC 50 ms
8,236 KB
testcase_25 AC 16 ms
7,940 KB
testcase_26 AC 16 ms
7,872 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 51 ms
8,296 KB
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def calc_score(box, i):
    global score
    for j in range(i+1, len(box)):
        if box[i][0] < box[j][0] and box[i][1] < box[j][1] and box[i][2] < box[j][2]:
            score[j] = max(score[j], score[i] + 1)
    return

N = int(input())
box = []
for i in range(N):
    tmp = list(map(int, input().split()))
    tmp.sort()
    box.append(tmp)

box.sort(key=lambda x:x[2])

score = [1 for i in range(N)]

for i in range(N):
    if score[i] == 1:
        calc_score(box, i)

print(max(score))
0