結果

問題 No.77 レンガのピラミッド
ユーザー rlangevinrlangevin
提出日時 2023-01-16 00:40:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 366 bytes
コンパイル時間 1,308 ms
コンパイル使用メモリ 86,772 KB
実行使用メモリ 76,268 KB
最終ジャッジ日時 2023-08-28 15:22:27
合計ジャッジ時間 3,393 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,328 KB
testcase_01 AC 72 ms
71,240 KB
testcase_02 AC 70 ms
71,260 KB
testcase_03 AC 70 ms
71,052 KB
testcase_04 AC 70 ms
71,040 KB
testcase_05 AC 72 ms
71,296 KB
testcase_06 WA -
testcase_07 AC 71 ms
71,096 KB
testcase_08 AC 80 ms
76,120 KB
testcase_09 AC 75 ms
74,904 KB
testcase_10 AC 74 ms
75,176 KB
testcase_11 AC 75 ms
74,988 KB
testcase_12 AC 78 ms
76,008 KB
testcase_13 AC 79 ms
75,944 KB
testcase_14 AC 78 ms
76,024 KB
testcase_15 AC 73 ms
74,924 KB
testcase_16 AC 72 ms
75,044 KB
testcase_17 AC 70 ms
71,288 KB
testcase_18 AC 80 ms
76,048 KB
testcase_19 AC 70 ms
71,212 KB
testcase_20 AC 68 ms
71,112 KB
testcase_21 AC 76 ms
76,268 KB
testcase_22 AC 73 ms
74,912 KB
testcase_23 AC 76 ms
75,984 KB
testcase_24 AC 72 ms
71,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def calc(X):
    v = S
    for i in range(min(len(X), len(A))):
        v -= min(X[i], A[i])
    return v

N = int(input())
A = list(map(int, input().split()))
S = sum(A)
ans = 10 ** 18
for i in range(1, 100):
    L = list(range(1, i + 1))
    for j in range(i - 1, -1, -1):
        L.append(j)
    if sum(L) > S:
        break
    ans = min(ans, calc(L))
print(ans)
0