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