結果

問題 No.505 カードの数式2
ユーザー tookunn_1213tookunn_1213
提出日時 2017-04-21 22:28:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 238 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 7,964 KB
最終ジャッジ日時 2023-09-27 11:17:57
合計ジャッジ時間 1,784 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,784 KB
testcase_01 AC 13 ms
7,756 KB
testcase_02 AC 14 ms
7,904 KB
testcase_03 AC 13 ms
7,900 KB
testcase_04 AC 15 ms
7,716 KB
testcase_05 AC 15 ms
7,856 KB
testcase_06 AC 15 ms
7,780 KB
testcase_07 AC 15 ms
7,760 KB
testcase_08 AC 13 ms
7,936 KB
testcase_09 AC 14 ms
7,720 KB
testcase_10 AC 13 ms
7,756 KB
testcase_11 AC 12 ms
7,748 KB
testcase_12 AC 13 ms
7,832 KB
testcase_13 WA -
testcase_14 AC 12 ms
7,872 KB
testcase_15 WA -
testcase_16 AC 13 ms
7,780 KB
testcase_17 WA -
testcase_18 AC 14 ms
7,856 KB
testcase_19 WA -
testcase_20 AC 14 ms
7,784 KB
testcase_21 AC 14 ms
7,940 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 13 ms
7,860 KB
testcase_31 AC 13 ms
7,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0