結果

問題 No.1077 Noelちゃんと星々4
コンテスト
ユーザー Kaku17132077
提出日時 2020-06-12 22:56:40
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 763 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 536 ms
コンパイル使用メモリ 20,900 KB
実行使用メモリ 20,784 KB
最終ジャッジ日時 2026-03-10 04:32:44
合計ジャッジ時間 6,138 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other RE * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

def min_min(i = 0, n = N, *list_Y):
    
    count =0
    if i == n-1:
        if list_Y[i] <= list_Y[i+1]:
            return list_Y
        else:
            while(list_Y[i] > list_Y[i+1]):
                list_Y[i+1] += 1
                count += 1
            return list_Y

    if list_Y[i] <= list_Y[i+1]:
        i += 1
        min_min(i, n, *list_Y)
    else:
        if list_Y[i+1] <= list_Y[i+2]:
            while(list_Y[i]>list_Y[i+1]):
                list_Y[i] -= 1
                count += 1
            i += 1
        else:
            while(list_Y[i]>list_Y[i+1]):
                list_Y[i+1] += 1
                count += 1
            i += 1
        min_min(i, n, *list_Y)

min_min(0, N, Y)
0