結果

問題 No.1816 MUL-DIV Game
ユーザー 👑 tamatotamato
提出日時 2022-01-21 21:46:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 87,792 KB
実行使用メモリ 90,788 KB
最終ジャッジ日時 2023-08-17 05:31:11
合計ジャッジ時間 4,436 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,916 KB
testcase_01 AC 81 ms
71,580 KB
testcase_02 AC 75 ms
71,868 KB
testcase_03 AC 75 ms
71,736 KB
testcase_04 AC 76 ms
71,796 KB
testcase_05 AC 76 ms
71,864 KB
testcase_06 AC 76 ms
71,816 KB
testcase_07 AC 73 ms
71,632 KB
testcase_08 AC 73 ms
71,756 KB
testcase_09 AC 75 ms
76,104 KB
testcase_10 AC 82 ms
80,980 KB
testcase_11 AC 82 ms
80,184 KB
testcase_12 AC 80 ms
78,752 KB
testcase_13 AC 96 ms
84,220 KB
testcase_14 AC 86 ms
79,340 KB
testcase_15 AC 89 ms
81,016 KB
testcase_16 AC 81 ms
76,032 KB
testcase_17 AC 108 ms
88,536 KB
testcase_18 AC 102 ms
87,228 KB
testcase_19 AC 90 ms
80,368 KB
testcase_20 AC 106 ms
88,660 KB
testcase_21 AC 87 ms
78,684 KB
testcase_22 AC 86 ms
77,776 KB
testcase_23 AC 72 ms
71,724 KB
testcase_24 AC 74 ms
71,584 KB
testcase_25 AC 112 ms
90,672 KB
testcase_26 AC 99 ms
90,084 KB
testcase_27 AC 113 ms
90,620 KB
testcase_28 AC 97 ms
90,168 KB
testcase_29 AC 112 ms
90,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline
    
    N = int(input())
    A = list(map(int, input().split()))
    
    if N & 1:
        if N == 1:
            print(A[0])
        else:
            print(1)
    else:
        if N == 2:
            print(A[0] * A[1])
        else:
            A.sort()
            print(min(A[2], A[0] * A[1]))


if __name__ == '__main__':
    main()
0