結果

問題 No.505 カードの数式2
ユーザー convexineq
提出日時 2021-02-12 05:17:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 159 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 82,848 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-07-18 15:11:55
合計ジャッジ時間 2,246 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
p = n = a[0]
for x in a[1:]:
    p = max(p*x,p+x,p-x,n*x,n+x,n-x)
    n = min(p*x,p+x,p-x,n*x,n+x,n-x)
print(p)
0