結果

問題 No.505 カードの数式2
ユーザー 0w10w1
提出日時 2017-04-21 22:45:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 297 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 71,532 KB
最終ジャッジ日時 2023-09-27 11:29:29
合計ジャッジ時間 3,489 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,196 KB
testcase_01 AC 63 ms
71,204 KB
testcase_02 AC 63 ms
71,248 KB
testcase_03 AC 63 ms
70,932 KB
testcase_04 AC 64 ms
71,352 KB
testcase_05 AC 71 ms
71,124 KB
testcase_06 AC 64 ms
71,128 KB
testcase_07 AC 65 ms
71,144 KB
testcase_08 AC 66 ms
71,156 KB
testcase_09 AC 62 ms
71,200 KB
testcase_10 AC 60 ms
70,984 KB
testcase_11 WA -
testcase_12 AC 63 ms
71,324 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 65 ms
71,232 KB
testcase_17 WA -
testcase_18 AC 67 ms
71,140 KB
testcase_19 WA -
testcase_20 AC 64 ms
71,228 KB
testcase_21 AC 63 ms
71,332 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 64 ms
71,304 KB
testcase_31 AC 66 ms
71,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int( input() )
A = list( map( int, input().split() ) )

ans = 0
def dfs( x, v ):
  if x == N:
    global ans
    ans = max( ans, v )
    return
  best = max( v + abs( A[ x ] ), v * A[ x ] )
  if A[ x ] != 0:
    best = max( best, v / A[ x ] )
  dfs( x + 1, best )
dfs( 1, A[ 0 ] )
print( ans )
0