結果

問題 No.3372 Suitable Constraint
コンテスト
ユーザー Meso Meso
提出日時 2025-11-22 09:53:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 342 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 32,228 KB
最終ジャッジ日時 2025-11-22 09:53:12
合計ジャッジ時間 5,698 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

t = int(input())

for _ in range(t):
    n = int(input())
    a = list(map(int, input().split()))
    
    pos = [x for x in a if x > 0]
    neg = [x for x in a if x < 0]
    zeros = a.count(0)

    if zeros >= 1:
        print(0)
    elif pos and neg:
        print(min(pos) * max(neg))
    elif neg == []:
        print(min(pos) * max(pos))
0