結果

問題 No.2210 equence Squence Seuence
ユーザー tamatotamato
提出日時 2023-02-10 21:37:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 601 bytes
コンパイル時間 1,134 ms
コンパイル使用メモリ 86,508 KB
実行使用メモリ 114,584 KB
最終ジャッジ日時 2023-09-21 22:41:41
合計ジャッジ時間 5,806 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
71,168 KB
testcase_01 AC 82 ms
71,296 KB
testcase_02 AC 80 ms
71,204 KB
testcase_03 AC 113 ms
85,568 KB
testcase_04 WA -
testcase_05 AC 120 ms
94,756 KB
testcase_06 AC 117 ms
90,720 KB
testcase_07 AC 153 ms
100,180 KB
testcase_08 AC 79 ms
70,932 KB
testcase_09 AC 85 ms
71,256 KB
testcase_10 AC 81 ms
71,216 KB
testcase_11 WA -
testcase_12 AC 77 ms
71,260 KB
testcase_13 AC 170 ms
107,260 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 181 ms
106,836 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 77 ms
71,240 KB
testcase_20 AC 79 ms
71,244 KB
testcase_21 AC 78 ms
71,212 KB
testcase_22 WA -
testcase_23 AC 159 ms
114,584 KB
testcase_24 AC 143 ms
105,708 KB
testcase_25 AC 143 ms
110,648 KB
testcase_26 AC 158 ms
106,980 KB
testcase_27 AC 110 ms
87,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353


def main():
    import sys
    input = sys.stdin.readline

    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    ans = [-1] * N
    l = 0
    r = N-1
    for i in range(N-1):
        if A[i] <= A[i+1]:
            ans[r] = i
            r -= 1
        elif A[i] > A[i+1]:
            ans[l] = i
            l += 1
    for i in range(N-1):
        if ans[i] == -1:
            ans[i] = N - 1
    B = []
    for i in range(N):
        if i == ans[K - 1]:
            continue
        B.append(A[i])
    print(*B)
    

if __name__ == '__main__':
    main()
0