結果

問題 No.505 カードの数式2
ユーザー kohei2019kohei2019
提出日時 2022-02-02 20:30:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 317 bytes
コンパイル時間 905 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 71,536 KB
最終ジャッジ日時 2023-09-02 02:58:31
合計ジャッジ時間 3,827 ms
ジャッジサーバーID
(参考情報)
judge16 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,328 KB
testcase_01 AC 64 ms
71,364 KB
testcase_02 AC 65 ms
71,328 KB
testcase_03 AC 65 ms
71,244 KB
testcase_04 AC 65 ms
71,068 KB
testcase_05 AC 70 ms
71,384 KB
testcase_06 AC 65 ms
71,428 KB
testcase_07 AC 67 ms
71,372 KB
testcase_08 AC 64 ms
71,516 KB
testcase_09 AC 66 ms
71,376 KB
testcase_10 AC 65 ms
71,380 KB
testcase_11 WA -
testcase_12 AC 65 ms
71,360 KB
testcase_13 WA -
testcase_14 AC 63 ms
71,536 KB
testcase_15 WA -
testcase_16 AC 65 ms
71,372 KB
testcase_17 WA -
testcase_18 AC 66 ms
71,428 KB
testcase_19 AC 69 ms
71,180 KB
testcase_20 AC 66 ms
71,376 KB
testcase_21 AC 66 ms
71,380 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 68 ms
71,144 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 68 ms
71,376 KB
testcase_31 AC 67 ms
71,364 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]
    ko1.sort(key=lambda x:abs(x))
    b = ko1[-1]
    ko = [a,b]
print(max(ko))
0