結果
| 問題 |
No.505 カードの数式2
|
| コンテスト | |
| ユーザー |
Watson
|
| 提出日時 | 2017-08-07 15:52:05 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 405 bytes |
| コンパイル時間 | 89 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-10-11 22:25:05 |
| 合計ジャッジ時間 | 2,261 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 8 RE * 11 |
ソースコード
N = int(input())
A = [int(i) for i in input().split()]
ans = A[0]
for i in range(1,N):
if ans+A[i]>=ans*A[i] and ans+A[i]>=ans/A[i] and ans+A[i]>=ans-A[i]:
ans += A[i]
elif ans-A[i]>ans*A[i] and ans-A[i]>ans/A[i] and ans-A[i]>ans+A[i]:
ans -= A[i]
elif ans*A[i]>ans+A[i] and ans*A[i]>ans-A[i] and ans*A[i]>ans/A[i]:
ans *= A[i]
else:
ans /= A[i]
print(ans)
Watson