結果

問題 No.505 カードの数式2
ユーザー 0w10w1
提出日時 2017-04-21 22:48:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 82,164 KB
実行使用メモリ 54,292 KB
最終ジャッジ日時 2024-07-20 05:37:49
合計ジャッジ時間 2,607 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,552 KB
testcase_01 AC 39 ms
53,080 KB
testcase_02 AC 43 ms
52,432 KB
testcase_03 AC 40 ms
52,136 KB
testcase_04 AC 38 ms
52,756 KB
testcase_05 AC 41 ms
52,628 KB
testcase_06 AC 41 ms
52,484 KB
testcase_07 AC 40 ms
52,672 KB
testcase_08 AC 37 ms
52,136 KB
testcase_09 AC 41 ms
52,868 KB
testcase_10 AC 41 ms
52,656 KB
testcase_11 AC 39 ms
52,284 KB
testcase_12 AC 38 ms
53,112 KB
testcase_13 WA -
testcase_14 AC 38 ms
52,964 KB
testcase_15 WA -
testcase_16 AC 39 ms
51,896 KB
testcase_17 WA -
testcase_18 AC 41 ms
53,140 KB
testcase_19 WA -
testcase_20 AC 40 ms
52,468 KB
testcase_21 AC 38 ms
52,904 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 37 ms
52,940 KB
testcase_31 AC 38 ms
52,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = - int( 1e30 )
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