結果
問題 |
No.505 カードの数式2
|
ユーザー |
![]() |
提出日時 | 2024-12-17 22:01:59 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 297 bytes |
コンパイル時間 | 530 ms |
コンパイル使用メモリ | 82,104 KB |
実行使用メモリ | 480,144 KB |
最終ジャッジ日時 | 2024-12-17 22:02:08 |
合計ジャッジ時間 | 7,207 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 WA * 2 TLE * 1 |
ソースコード
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) if a != 0: Q2.add(x // a) Q = Q2 print(max(list(Q)))