結果
| 問題 |
No.1045 直方体大学
|
| コンテスト | |
| ユーザー |
tamato
|
| 提出日時 | 2020-05-01 22:31:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 879 bytes |
| コンパイル時間 | 749 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 64,896 KB |
| 最終ジャッジ日時 | 2024-12-25 13:05:34 |
| 合計ジャッジ時間 | 2,818 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 2 RE * 15 |
ソースコード
mod = 1000000007
eps = 10**-9
def main():
import sys
input = sys.stdin.readline
N = int(input())
xyz = []
for _ in range(N):
a, b, c = map(int, input().split())
xyz.append(sorted([a, b, c]) + [0])
if N == 1:
print(max(xyz[0]))
exit()
while True:
xyz.sort(key= lambda p: p[1], reverse=True)
ok = 1
for i in range(N-1):
if xyz[i+1][0] > xyz[i][0]:
ok = 0
x, y, z, w = xyz[i+1]
if w == 0:
xyz[i+1] = [x, z, y, 1]
elif w == 1:
xyz[i+1] = [y, z, x, 2]
else:
assert False
if ok:
ans = 0
for i in range(N):
ans += xyz[i][2]
break
print(ans)
if __name__ == '__main__':
main()
tamato