結果

問題 No.505 カードの数式2
ユーザー kohei2019kohei2019
提出日時 2022-02-02 20:32:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 283 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 71,680 KB
最終ジャッジ日時 2023-09-02 02:58:39
合計ジャッジ時間 3,960 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,340 KB
testcase_01 AC 66 ms
71,324 KB
testcase_02 AC 66 ms
71,560 KB
testcase_03 AC 67 ms
71,588 KB
testcase_04 AC 70 ms
71,324 KB
testcase_05 AC 66 ms
71,544 KB
testcase_06 AC 67 ms
71,284 KB
testcase_07 AC 66 ms
71,512 KB
testcase_08 AC 64 ms
71,424 KB
testcase_09 AC 64 ms
71,508 KB
testcase_10 AC 64 ms
71,508 KB
testcase_11 WA -
testcase_12 AC 65 ms
71,628 KB
testcase_13 AC 65 ms
71,552 KB
testcase_14 AC 66 ms
71,360 KB
testcase_15 AC 65 ms
71,680 KB
testcase_16 AC 65 ms
71,392 KB
testcase_17 WA -
testcase_18 AC 68 ms
71,292 KB
testcase_19 AC 65 ms
71,596 KB
testcase_20 AC 63 ms
71,580 KB
testcase_21 AC 65 ms
71,284 KB
testcase_22 AC 67 ms
71,620 KB
testcase_23 AC 66 ms
71,232 KB
testcase_24 AC 64 ms
71,392 KB
testcase_25 AC 66 ms
71,284 KB
testcase_26 AC 65 ms
71,324 KB
testcase_27 AC 65 ms
71,416 KB
testcase_28 AC 67 ms
71,452 KB
testcase_29 WA -
testcase_30 AC 65 ms
71,176 KB
testcase_31 AC 66 ms
71,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
lsa = list(map(int,input().split()))
ko = [lsa[0]]

for i in range(1,N):
    ko1 = []
    for k in ko:
        ko1.append(k+lsa[i])
        ko1.append(k-lsa[i])
        ko1.append(k*lsa[i])
    ko1.sort()
    a = ko1[-1]
    b = ko1[0]
    ko = [a,b]
print(max(ko))
0