結果

問題 No.505 カードの数式2
ユーザー titiatitia
提出日時 2023-07-17 02:41:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 286 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 11,948 KB
実行使用メモリ 432,900 KB
最終ジャッジ日時 2023-10-18 00:16:00
合計ジャッジ時間 7,087 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,208 KB
testcase_01 AC 29 ms
10,172 KB
testcase_02 AC 45 ms
14,088 KB
testcase_03 AC 29 ms
10,128 KB
testcase_04 AC 29 ms
10,128 KB
testcase_05 AC 28 ms
10,128 KB
testcase_06 AC 28 ms
10,128 KB
testcase_07 AC 29 ms
10,128 KB
testcase_08 AC 29 ms
10,128 KB
testcase_09 AC 28 ms
10,128 KB
testcase_10 AC 28 ms
10,128 KB
testcase_11 AC 28 ms
10,128 KB
testcase_12 AC 27 ms
10,128 KB
testcase_13 AC 28 ms
10,128 KB
testcase_14 AC 28 ms
10,128 KB
testcase_15 AC 28 ms
10,128 KB
testcase_16 AC 28 ms
10,128 KB
testcase_17 WA -
testcase_18 AC 28 ms
10,128 KB
testcase_19 AC 29 ms
10,136 KB
testcase_20 AC 28 ms
10,128 KB
testcase_21 AC 28 ms
10,128 KB
testcase_22 AC 456 ms
66,116 KB
testcase_23 AC 113 ms
22,744 KB
testcase_24 AC 29 ms
10,172 KB
testcase_25 AC 29 ms
10,176 KB
testcase_26 AC 889 ms
123,136 KB
testcase_27 AC 606 ms
104,404 KB
testcase_28 TLE -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))

NOW={A[0]}

for i in range(1,N):
    NNOW=set()
    a=A[i]

    for n in NOW:
        NNOW.add(n+a)
        NNOW.add(n-a)
        NNOW.add(n*a)

        if n<0 and a>0:
            NNOW.add(-abs(n)//abs(a))

    NOW=NNOW

print(max(NOW))
0