結果

問題 No.1816 MUL-DIV Game
ユーザー chineristACchineristAC
提出日時 2022-01-21 21:30:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 773 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 93,924 KB
最終ジャッジ日時 2023-08-17 05:02:55
合計ジャッジ時間 5,795 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
74,480 KB
testcase_01 AC 114 ms
74,620 KB
testcase_02 AC 114 ms
74,628 KB
testcase_03 AC 113 ms
74,672 KB
testcase_04 AC 115 ms
74,508 KB
testcase_05 AC 113 ms
74,520 KB
testcase_06 AC 113 ms
74,536 KB
testcase_07 AC 115 ms
74,420 KB
testcase_08 AC 116 ms
74,512 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
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 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations

from math import log,gcd

input = lambda :sys.stdin.readline()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

N = int(input())
A = li()

A.sort()

if N==1:
    exit(print(A[0]))
if N==2:
    exit(print(A[0]*A[1]))

if all(A[i]==1 for i in range(N)):
    exit(print(1))

if all(A[0]*A[1]==A[i] for i in range(2,N)):
    if N&1:
        print(1)
    else:
        print(A[2])
elif all(A[0]*A[-1]==A[i] for i in range(1,N-1)):
    if N&1:
        print(1)
    else:
        print(A[1])
elif all(A[-2]*A[-1]==A[i] for i in range(0,N-2)):
    if N&1:
        print(1)
    else:
        print(A[0])
else:
    print(0)
0