結果

問題 No.497 入れ子の箱
ユーザー 6soukiti29
提出日時 2017-03-26 07:03:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-07-06 05:20:42
合計ジャッジ時間 11,482 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 19
権限があれば一括ダウンロードができます

ソースコード

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