結果

問題 No.497 入れ子の箱
ユーザー 6soukiti296soukiti29
提出日時 2017-03-26 07:03:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 10,808 KB
実行使用メモリ 8,764 KB
最終ジャッジ日時 2023-09-20 09:45:23
合計ジャッジ時間 13,623 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,860 KB
testcase_01 AC 16 ms
7,780 KB
testcase_02 AC 16 ms
7,920 KB
testcase_03 AC 66 ms
8,692 KB
testcase_04 AC 67 ms
8,560 KB
testcase_05 AC 66 ms
8,680 KB
testcase_06 AC 66 ms
8,724 KB
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 1,662 ms
8,240 KB
testcase_24 AC 1,571 ms
8,492 KB
testcase_25 AC 16 ms
7,904 KB
testcase_26 AC 16 ms
7,976 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 1,741 ms
8,560 KB
testcase_31 AC 1,827 ms
8,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = []
for n in range(N):
	X,Y,Z = map(int,input().split())
	V = X*Y*Z
	A.append([X,Y,Z,V])
A.sort(key = lambda x: - x[3])
B = [[float("inf") for i in range(3)] + [0]]
for a in A:
	for b in B:
		P = [0] * 3
		for i in range(3):
			p = 0
			for j in range(3):
				if (b[j] > a[(j + i) % 3]):
					p = p + 1
			if p == 3:
				P[i] = 1
		if 1 in P:
			B.append(a[:-1] + [b[3] + 1])
			B.sort(key = lambda x: - x[3])
			break
print(B[0][3])
0