結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,732 KB
testcase_01 AC 17 ms
7,860 KB
testcase_02 AC 32 ms
7,772 KB
testcase_03 AC 18 ms
7,808 KB
testcase_04 AC 15 ms
7,812 KB
testcase_05 AC 16 ms
7,844 KB
testcase_06 AC 16 ms
7,724 KB
testcase_07 AC 16 ms
7,808 KB
testcase_08 AC 16 ms
7,788 KB
testcase_09 AC 17 ms
7,944 KB
testcase_10 AC 17 ms
7,848 KB
testcase_11 WA -
testcase_12 AC 16 ms
7,848 KB
testcase_13 WA -
testcase_14 AC 15 ms
7,780 KB
testcase_15 WA -
testcase_16 AC 16 ms
7,780 KB
testcase_17 WA -
testcase_18 AC 16 ms
7,780 KB
testcase_19 WA -
testcase_20 AC 18 ms
7,772 KB
testcase_21 AC 86 ms
7,788 KB
testcase_22 AC 179 ms
7,808 KB
testcase_23 AC 64 ms
7,732 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 92 ms
7,776 KB
testcase_27 AC 45 ms
7,844 KB
testcase_28 AC 171 ms
7,860 KB
testcase_29 WA -
testcase_30 AC 29 ms
7,856 KB
testcase_31 AC 31 ms
7,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
a = [int(i) for i in input().split()]
ans = -10**10
def dfs(n,m):
	if n == N:
		global ans
		ans = max(ans,m)
		return
	dfs(n+1,m + a[n])
	if a[n] < 0:
		dfs(n+1,m - a[n])
	dfs(n+1,m * a[n])
	return
dfs(1,a[0])
print(ans)
0