結果

問題 No.1816 MUL-DIV Game
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-01-21 22:13:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 823 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 92,172 KB
最終ジャッジ日時 2023-08-17 06:19:41
合計ジャッジ時間 5,181 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,360 KB
testcase_01 AC 70 ms
71,356 KB
testcase_02 AC 70 ms
71,244 KB
testcase_03 AC 70 ms
71,240 KB
testcase_04 AC 70 ms
71,360 KB
testcase_05 AC 71 ms
71,380 KB
testcase_06 AC 73 ms
71,400 KB
testcase_07 AC 73 ms
71,460 KB
testcase_08 AC 70 ms
71,520 KB
testcase_09 AC 75 ms
75,680 KB
testcase_10 AC 88 ms
81,128 KB
testcase_11 AC 86 ms
80,188 KB
testcase_12 AC 83 ms
78,668 KB
testcase_13 AC 134 ms
85,308 KB
testcase_14 AC 115 ms
80,900 KB
testcase_15 AC 123 ms
82,016 KB
testcase_16 AC 101 ms
77,944 KB
testcase_17 AC 146 ms
90,076 KB
testcase_18 AC 142 ms
88,604 KB
testcase_19 AC 119 ms
82,120 KB
testcase_20 AC 149 ms
90,196 KB
testcase_21 AC 113 ms
80,656 KB
testcase_22 AC 111 ms
79,596 KB
testcase_23 AC 76 ms
71,472 KB
testcase_24 AC 76 ms
71,408 KB
testcase_25 AC 157 ms
92,144 KB
testcase_26 AC 111 ms
91,348 KB
testcase_27 AC 157 ms
92,132 KB
testcase_28 AC 110 ms
91,312 KB
testcase_29 AC 158 ms
92,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))
a.sort()
if n == 1:
    print(a[0])
elif n == 2:
    print(a[0]*a[1])
elif n & 1:
    print(1)
else:
    import heapq
    x,y = heapq.heappop(a),heapq.heappop(a)
    heapq.heappush(a,x*y)
    for i in range(n//2-1):
        x = heapq.heappop(a)
        heapq.heappush(a,x)
    print(x)
0