結果

問題 No.505 カードの数式2
ユーザー titiatitia
提出日時 2023-07-17 02:39:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 223 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 11,856 KB
実行使用メモリ 388,200 KB
最終ジャッジ日時 2023-10-18 00:15:33
合計ジャッジ時間 6,541 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,104 KB
testcase_01 AC 29 ms
10,144 KB
testcase_02 AC 43 ms
14,060 KB
testcase_03 AC 29 ms
10,104 KB
testcase_04 AC 30 ms
10,104 KB
testcase_05 AC 30 ms
10,104 KB
testcase_06 AC 28 ms
10,104 KB
testcase_07 AC 30 ms
10,104 KB
testcase_08 AC 30 ms
10,104 KB
testcase_09 AC 30 ms
10,104 KB
testcase_10 AC 29 ms
10,104 KB
testcase_11 WA -
testcase_12 AC 29 ms
10,104 KB
testcase_13 AC 29 ms
10,104 KB
testcase_14 AC 29 ms
10,104 KB
testcase_15 AC 29 ms
10,104 KB
testcase_16 AC 29 ms
10,104 KB
testcase_17 WA -
testcase_18 AC 29 ms
10,104 KB
testcase_19 AC 29 ms
10,108 KB
testcase_20 AC 29 ms
10,104 KB
testcase_21 AC 29 ms
10,104 KB
testcase_22 AC 328 ms
65,280 KB
testcase_23 AC 85 ms
22,648 KB
testcase_24 AC 30 ms
10,144 KB
testcase_25 AC 30 ms
10,148 KB
testcase_26 AC 533 ms
104,180 KB
testcase_27 AC 525 ms
104,008 KB
testcase_28 TLE -
testcase_29 WA -
testcase_30 AC 29 ms
10,104 KB
testcase_31 AC 543 ms
104,136 KB
権限があれば一括ダウンロードができます

ソースコード

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)

    NOW=NNOW

print(max(NOW))
0