結果
問題 | No.1816 MUL-DIV Game |
ユーザー | rlangevin |
提出日時 | 2023-02-19 01:02:26 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 327 bytes |
コンパイル時間 | 621 ms |
コンパイル使用メモリ | 87,188 KB |
実行使用メモリ | 92,028 KB |
最終ジャッジ日時 | 2023-09-27 12:43:04 |
合計ジャッジ時間 | 7,575 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 76 ms
71,260 KB |
testcase_01 | AC | 77 ms
71,380 KB |
testcase_02 | AC | 78 ms
71,064 KB |
testcase_03 | AC | 75 ms
70,952 KB |
testcase_04 | AC | 75 ms
71,276 KB |
testcase_05 | AC | 78 ms
71,412 KB |
testcase_06 | AC | 77 ms
71,208 KB |
testcase_07 | AC | 79 ms
71,356 KB |
testcase_08 | AC | 79 ms
71,196 KB |
testcase_09 | AC | 110 ms
77,276 KB |
testcase_10 | AC | 125 ms
81,892 KB |
testcase_11 | AC | 124 ms
81,672 KB |
testcase_12 | AC | 122 ms
80,008 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 77 ms
71,348 KB |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | AC | 144 ms
91,588 KB |
testcase_27 | WA | - |
testcase_28 | AC | 144 ms
92,028 KB |
testcase_29 | WA | - |
ソースコード
from heapq import * N = int(input()) A = list(map(int, input().split())) heapify(A) if N == 1: print(A[0]) exit() elif N == 2: print(A[0] * A[1]) exit() elif N % 2: print(1) exit() for i in range(N//2 - 1): a = heappop(A) b = heappop(A) if i % 2 == 0: heappush(A, a * b) print(A[0])