結果

問題 No.77 レンガのピラミッド
ユーザー maimai
提出日時 2017-05-22 07:39:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 438 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 81,624 KB
実行使用メモリ 70,548 KB
最終ジャッジ日時 2023-10-19 12:55:43
合計ジャッジ時間 2,303 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,380 KB
testcase_01 AC 39 ms
53,380 KB
testcase_02 AC 40 ms
53,380 KB
testcase_03 AC 39 ms
53,380 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 40 ms
53,380 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 38 ms
53,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
aa = list(map(int,input().split()))

aasum = sum(aa)

result = aasum
for l in range(n-1):
    for r in range(l,n):
        if (r-l)%2: continue
        bb = [0]*n
        for x in range(l,r+1):
            bb[x] = min(x-l,r-x)+1
        if sum(bb) > aasum: continue
        s = 0
        for x in range(n):
            s+= max(0,aa[x]-bb[x]) # 減らす方のみカウント
        result = min(result,s)

print(result)
0