結果

問題 No.1816 MUL-DIV Game
ユーザー MineMine
提出日時 2022-01-29 22:32:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 293 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 19,608 KB
最終ジャッジ日時 2023-08-30 22:17:42
合計ジャッジ時間 4,278 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,544 KB
testcase_01 AC 17 ms
8,548 KB
testcase_02 AC 18 ms
8,492 KB
testcase_03 AC 18 ms
8,480 KB
testcase_04 AC 18 ms
8,496 KB
testcase_05 AC 18 ms
8,496 KB
testcase_06 AC 17 ms
8,624 KB
testcase_07 AC 17 ms
8,648 KB
testcase_08 AC 18 ms
8,492 KB
testcase_09 AC 24 ms
9,540 KB
testcase_10 AC 51 ms
13,220 KB
testcase_11 AC 47 ms
12,876 KB
testcase_12 AC 39 ms
11,796 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 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 100 ms
19,344 KB
testcase_27 WA -
testcase_28 AC 97 ms
19,532 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n = int(input())
a = list(map(int, input().split()))
a.sort()
a = deque(a)
for i in range(n-1):
    if i % 2 == 0:
        v1 = a.popleft()
        v2 = a.pop()
        a.append(v1*v2)
    else:
        a.pop()
        a.pop()
        a.appendleft(1)
print(a[0])
0