結果

問題 No.505 カードの数式2
ユーザー ntudantuda
提出日時 2024-12-17 21:58:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 244 bytes
コンパイル時間 592 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 347,180 KB
最終ジャッジ日時 2024-12-17 21:58:22
合計ジャッジ時間 5,153 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,336 KB
testcase_01 AC 38 ms
52,688 KB
testcase_02 AC 50 ms
68,228 KB
testcase_03 AC 40 ms
52,820 KB
testcase_04 AC 37 ms
53,000 KB
testcase_05 AC 38 ms
53,220 KB
testcase_06 AC 38 ms
53,604 KB
testcase_07 AC 37 ms
52,620 KB
testcase_08 AC 38 ms
52,092 KB
testcase_09 AC 40 ms
53,292 KB
testcase_10 AC 35 ms
53,312 KB
testcase_11 WA -
testcase_12 AC 38 ms
52,856 KB
testcase_13 AC 36 ms
53,112 KB
testcase_14 AC 39 ms
52,432 KB
testcase_15 AC 38 ms
51,812 KB
testcase_16 AC 37 ms
53,252 KB
testcase_17 WA -
testcase_18 AC 39 ms
52,728 KB
testcase_19 AC 37 ms
52,848 KB
testcase_20 AC 39 ms
52,156 KB
testcase_21 AC 38 ms
52,620 KB
testcase_22 AC 215 ms
174,032 KB
testcase_23 AC 77 ms
92,468 KB
testcase_24 AC 39 ms
53,424 KB
testcase_25 AC 39 ms
52,900 KB
testcase_26 AC 322 ms
181,304 KB
testcase_27 AC 283 ms
195,188 KB
testcase_28 AC 1,421 ms
347,180 KB
testcase_29 WA -
testcase_30 AC 38 ms
52,948 KB
testcase_31 AC 283 ms
181,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
Q = {A[0]}
for a in A[1:]:
    Q2 = set()
    while Q:
        x = next(iter(Q))
        Q.remove(x)
        Q2.add(x+a)
        Q2.add(x-a)
        Q2.add(x*a)
    Q = Q2
print(max(list(Q)))
0