結果

問題 No.2210 equence Squence Seuence
ユーザー first_vilfirst_vil
提出日時 2023-02-10 22:06:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 877 bytes
コンパイル時間 437 ms
コンパイル使用メモリ 87,160 KB
実行使用メモリ 125,012 KB
最終ジャッジ日時 2023-09-21 23:22:47
合計ジャッジ時間 6,191 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,440 KB
testcase_01 AC 80 ms
71,532 KB
testcase_02 AC 79 ms
71,080 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 113 ms
90,648 KB
testcase_07 AC 142 ms
106,648 KB
testcase_08 WA -
testcase_09 AC 75 ms
71,108 KB
testcase_10 AC 75 ms
71,552 KB
testcase_11 AC 78 ms
71,440 KB
testcase_12 AC 77 ms
71,588 KB
testcase_13 AC 157 ms
107,328 KB
testcase_14 AC 164 ms
107,536 KB
testcase_15 AC 164 ms
107,508 KB
testcase_16 AC 156 ms
107,568 KB
testcase_17 WA -
testcase_18 AC 74 ms
71,268 KB
testcase_19 AC 74 ms
71,628 KB
testcase_20 WA -
testcase_21 AC 73 ms
71,328 KB
testcase_22 WA -
testcase_23 AC 161 ms
114,940 KB
testcase_24 AC 142 ms
105,812 KB
testcase_25 AC 151 ms
110,876 KB
testcase_26 AC 163 ms
125,012 KB
testcase_27 AC 115 ms
87,712 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()

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

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