結果
問題 | No.505 カードの数式2 |
ユーザー |
![]() |
提出日時 | 2018-07-10 23:11:09 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 367 bytes |
コンパイル時間 | 292 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-09-14 00:18:30 |
合計ジャッジ時間 | 2,480 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 4 RE * 10 |
ソースコード
N=int(input()) S=input() S=S.rstrip().split(" ") list1=[] for i in range(N): list1.append(int(S[i])) #print(list1) ans=list1[0] for j in range(1,N): if ans==0: list2=[ans+list1[j],ans-list1[j],ans*list1[j]] ans=max(list2) else: list2=[ans+list1[j],ans-list1[j],ans*list1[j],int(ans/list1[j])] ans=max(list2) print(ans)