結果

問題 No.1816 MUL-DIV Game
ユーザー titiatitia
提出日時 2022-01-21 21:42:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 10,596 KB
実行使用メモリ 19,068 KB
最終ジャッジ日時 2023-08-17 05:22:59
合計ジャッジ時間 2,963 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,696 KB
testcase_01 AC 20 ms
7,620 KB
testcase_02 AC 15 ms
7,692 KB
testcase_03 AC 16 ms
7,784 KB
testcase_04 AC 15 ms
7,852 KB
testcase_05 AC 16 ms
7,880 KB
testcase_06 AC 16 ms
7,696 KB
testcase_07 AC 16 ms
7,788 KB
testcase_08 AC 17 ms
7,752 KB
testcase_09 AC 19 ms
9,160 KB
testcase_10 AC 31 ms
13,008 KB
testcase_11 AC 29 ms
12,220 KB
testcase_12 AC 25 ms
11,032 KB
testcase_13 AC 51 ms
14,644 KB
testcase_14 AC 34 ms
11,812 KB
testcase_15 AC 41 ms
13,096 KB
testcase_16 AC 21 ms
9,420 KB
testcase_17 AC 65 ms
16,764 KB
testcase_18 AC 62 ms
16,616 KB
testcase_19 AC 38 ms
12,592 KB
testcase_20 AC 65 ms
17,516 KB
testcase_21 AC 31 ms
11,560 KB
testcase_22 AC 28 ms
10,732 KB
testcase_23 AC 16 ms
7,624 KB
testcase_24 AC 16 ms
7,700 KB
testcase_25 AC 74 ms
19,056 KB
testcase_26 AC 45 ms
18,984 KB
testcase_27 AC 75 ms
18,872 KB
testcase_28 AC 46 ms
19,008 KB
testcase_29 AC 75 ms
19,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))

if N==1:
    print(A[0])
elif N==2:
    print(A[0]*A[1])
elif N%2==1:
    print(1)
elif 1 in A:
    print(1)
else:
    A.sort()
    B=A[2:]+[A[0]*A[1]]
    print(min(B))
    
    
0