結果

問題 No.2210 equence Squence Seuence
ユーザー 👑 timitimi
提出日時 2023-02-11 15:13:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 448 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 131,480 KB
最終ジャッジ日時 2023-09-22 12:12:04
合計ジャッジ時間 5,389 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,364 KB
testcase_01 AC 69 ms
71,344 KB
testcase_02 AC 70 ms
71,088 KB
testcase_03 AC 101 ms
86,920 KB
testcase_04 AC 103 ms
88,880 KB
testcase_05 AC 115 ms
97,668 KB
testcase_06 AC 110 ms
93,156 KB
testcase_07 AC 150 ms
118,116 KB
testcase_08 AC 70 ms
71,600 KB
testcase_09 AC 72 ms
71,360 KB
testcase_10 AC 72 ms
71,396 KB
testcase_11 AC 70 ms
71,392 KB
testcase_12 AC 70 ms
71,492 KB
testcase_13 AC 162 ms
108,984 KB
testcase_14 AC 166 ms
108,864 KB
testcase_15 AC 168 ms
109,200 KB
testcase_16 AC 160 ms
109,080 KB
testcase_17 AC 162 ms
108,944 KB
testcase_18 AC 72 ms
71,292 KB
testcase_19 AC 70 ms
71,112 KB
testcase_20 AC 70 ms
71,420 KB
testcase_21 AC 70 ms
71,280 KB
testcase_22 AC 70 ms
71,292 KB
testcase_23 AC 138 ms
120,312 KB
testcase_24 AC 125 ms
110,100 KB
testcase_25 AC 131 ms
115,064 KB
testcase_26 AC 152 ms
131,480 KB
testcase_27 AC 104 ms
89,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int, input().split())
A=list(map(int, input().split()))
if A[0]*N==A:
  print(A)
  exit()
a,b=1,K 
B=A[::-1]
C=[0]
for i in range(len(B)-1):
  if B[i]<B[i+1]:
    C.append(1)
  elif B[i]>B[i+1]:
    C.append(-1)
  else:
    C.append(C[-1])
C=C[::-1]
a,b=1,N
for i in range(N):
  if C[i]==0:
    break 
  if C[i]==1:
    if a==K:
      break
    else:
      a+=1
  else:
    if b==K:
      break 
    else:
      b-=1
print(*(A[:i]+A[i+1:]))
0