結果

問題 No.505 カードの数式2
ユーザー 0w10w1
提出日時 2017-04-21 22:48:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 86,756 KB
実行使用メモリ 71,580 KB
最終ジャッジ日時 2023-09-27 11:32:04
合計ジャッジ時間 4,208 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,536 KB
testcase_01 AC 74 ms
71,212 KB
testcase_02 AC 75 ms
71,280 KB
testcase_03 AC 74 ms
71,240 KB
testcase_04 AC 73 ms
71,368 KB
testcase_05 AC 73 ms
71,316 KB
testcase_06 AC 73 ms
71,468 KB
testcase_07 AC 75 ms
71,424 KB
testcase_08 AC 72 ms
71,356 KB
testcase_09 AC 73 ms
71,028 KB
testcase_10 AC 73 ms
71,232 KB
testcase_11 AC 74 ms
71,344 KB
testcase_12 AC 73 ms
71,248 KB
testcase_13 WA -
testcase_14 AC 72 ms
71,232 KB
testcase_15 WA -
testcase_16 AC 72 ms
71,208 KB
testcase_17 WA -
testcase_18 AC 72 ms
71,472 KB
testcase_19 WA -
testcase_20 AC 72 ms
71,476 KB
testcase_21 AC 72 ms
71,360 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 71 ms
71,292 KB
testcase_31 AC 73 ms
71,568 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