結果

問題 No.1816 MUL-DIV Game
ユーザー SidewaysOwl
提出日時 2022-01-21 21:27:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 322 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 93,952 KB
最終ジャッジ日時 2024-11-25 22:37:48
合計ジャッジ時間 3,176 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))
from collections import deque
a.sort()
q = deque(a)
cnt = 1
# print(a)
while len(q) > 1:
    if cnt & 1:
        a,b = q.pop(),q.pop()
        q.append(a*b)
    else:
        a,b = q.pop(),q.popleft()
        q.appendleft((-(-b//a)))
    cnt += 1
print(q.pop())
        
0