結果
問題 |
No.505 カードの数式2
|
ユーザー |
![]() |
提出日時 | 2017-04-21 22:28:34 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 238 bytes |
コンパイル時間 | 159 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-20 05:24:45 |
合計ジャッジ時間 | 2,225 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 12 |
ソースコード
N = int(input()) a = [int(i) for i in input().split()] ans = a[0] for i in range(1,N): ma = -10**10 ma = max(ma,ans + a[i]) ma = max(ma,ans - a[i]) ma = max(ma,ans * a[i]) if a[i] != 0: ma = max(ma,ans // a[i]) ans = ma print(ans)