結果

問題 No.2210 equence Squence Seuence
ユーザー ygd.ygd.
提出日時 2023-02-10 21:52:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 205 ms / 2,000 ms
コード長 1,230 bytes
コンパイル時間 853 ms
コンパイル使用メモリ 10,804 KB
実行使用メモリ 30,696 KB
最終ジャッジ日時 2023-09-21 23:00:59
合計ジャッジ時間 5,297 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,560 KB
testcase_01 AC 20 ms
8,700 KB
testcase_02 AC 19 ms
8,680 KB
testcase_03 AC 54 ms
13,292 KB
testcase_04 AC 59 ms
14,096 KB
testcase_05 AC 80 ms
17,388 KB
testcase_06 AC 77 ms
15,840 KB
testcase_07 AC 147 ms
28,132 KB
testcase_08 AC 19 ms
8,524 KB
testcase_09 AC 19 ms
8,592 KB
testcase_10 AC 20 ms
8,612 KB
testcase_11 AC 19 ms
8,632 KB
testcase_12 AC 19 ms
8,684 KB
testcase_13 AC 171 ms
30,284 KB
testcase_14 AC 203 ms
30,340 KB
testcase_15 AC 205 ms
30,172 KB
testcase_16 AC 172 ms
30,440 KB
testcase_17 AC 177 ms
30,344 KB
testcase_18 AC 20 ms
8,632 KB
testcase_19 AC 19 ms
8,540 KB
testcase_20 AC 20 ms
8,668 KB
testcase_21 AC 19 ms
8,524 KB
testcase_22 AC 19 ms
8,508 KB
testcase_23 AC 152 ms
27,180 KB
testcase_24 AC 118 ms
22,500 KB
testcase_25 AC 136 ms
25,880 KB
testcase_26 AC 177 ms
30,696 KB
testcase_27 AC 63 ms
14,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline
#input = sys.stdin.buffer.readline #文字列はダメ
#sys.setrecursionlimit(1000000)
#import math
import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
from collections import defaultdict
from collections import deque
#import copy #DeepCopy: hoge = [_[:] for _ in hogehoge]
#from functools import lru_cache
#@lru_cache(maxsize=None)
#MOD = pow(10,9) + 7
MOD = 998244353
dx = [1,0,-1,0]
dy = [0,1,0,-1]
#dx8 = [1,1,0,-1,-1,-1,0,1]
#dy8 = [0,1,1,1,0,-1,-1,-1]

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

    def output(j):
        B = []
        for i,a in enumerate(A):
            if i == j: continue
            B.append(a)
        print(*B)
        exit()

    f = 1
    l = N
    s = 1
    for i in range(N-1):
        if A[i] == A[i+1]:
            s += 1
        elif A[i] > A[i+1]:
            pf = f
            f += s
            if pf <= K < f:
                output(i)
            s = 1
        else:
            pl = l
            l -= s
            if l < K <= pl:
                output(i)
            s = 1
        # print(f,l,s)
    output(N-1)


    

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