結果

問題 No.2210 equence Squence Seuence
ユーザー first_vilfirst_vil
提出日時 2023-02-10 22:15:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 926 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 125,072 KB
最終ジャッジ日時 2023-09-21 23:31:28
合計ジャッジ時間 5,320 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,448 KB
testcase_01 AC 69 ms
71,112 KB
testcase_02 AC 69 ms
71,348 KB
testcase_03 AC 104 ms
84,404 KB
testcase_04 AC 102 ms
86,044 KB
testcase_05 AC 117 ms
93,160 KB
testcase_06 AC 105 ms
90,800 KB
testcase_07 AC 136 ms
106,360 KB
testcase_08 AC 68 ms
71,268 KB
testcase_09 AC 70 ms
71,376 KB
testcase_10 AC 70 ms
71,112 KB
testcase_11 AC 73 ms
71,612 KB
testcase_12 AC 70 ms
71,480 KB
testcase_13 AC 149 ms
107,348 KB
testcase_14 AC 166 ms
107,612 KB
testcase_15 AC 163 ms
107,344 KB
testcase_16 AC 148 ms
107,336 KB
testcase_17 AC 150 ms
107,508 KB
testcase_18 AC 70 ms
71,456 KB
testcase_19 AC 73 ms
71,652 KB
testcase_20 AC 70 ms
71,460 KB
testcase_21 AC 72 ms
71,564 KB
testcase_22 AC 70 ms
71,272 KB
testcase_23 AC 139 ms
115,412 KB
testcase_24 AC 122 ms
105,876 KB
testcase_25 AC 131 ms
110,568 KB
testcase_26 AC 148 ms
125,072 KB
testcase_27 AC 95 ms
87,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

int1 = lambda x: int(x) - 1

# input = lambda: sys.stdin.buffer.readline()
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
i1 = lambda: int1(input())
mi = lambda: map(int, input().split())
mi1 = lambda: map(int1, input().split())
li = lambda: list(mi())
li1 = lambda: list(mi1())
lli = lambda n: [li() for _ in range(n)]

INF = float("inf")
# mod = int(1e9 + 7)
mod = 998244353

n, k = mi()
a = li()

l = 0

b = []
for i in range(n - 1):
    # i要素目の値が何になるか考える
    if a[i] == a[i + 1]:
        b.append(a[i])
        continue

    pre = (i + 1) - l
    suf = (n - i) - pre
    if a[i] < a[i + 1]:
        if k <= suf:
            l = i + 1
        else:
            b += a[i + 1 :]
            break
    else:
        if k <= pre:
            b += a[i + 1 :]
            break
        else:
            k -= pre
            l = i + 1
    b.append(a[i])
print(*b)
0