結果
問題 | No.2210 equence Squence Seuence |
ユーザー | coder_So_hey |
提出日時 | 2023-02-10 22:05:00 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 740 bytes |
コンパイル時間 | 321 ms |
コンパイル使用メモリ | 87,244 KB |
実行使用メモリ | 110,880 KB |
最終ジャッジ日時 | 2023-09-21 23:21:28 |
合計ジャッジ時間 | 6,206 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 77 ms
71,460 KB |
testcase_01 | AC | 73 ms
71,272 KB |
testcase_02 | AC | 71 ms
71,244 KB |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | AC | 107 ms
88,164 KB |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | AC | 73 ms
71,552 KB |
testcase_10 | AC | 71 ms
71,356 KB |
testcase_11 | RE | - |
testcase_12 | AC | 72 ms
71,352 KB |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | RE | - |
testcase_16 | RE | - |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
testcase_20 | AC | 71 ms
71,532 KB |
testcase_21 | RE | - |
testcase_22 | RE | - |
testcase_23 | AC | 137 ms
110,880 KB |
testcase_24 | AC | 126 ms
103,612 KB |
testcase_25 | AC | 132 ms
106,548 KB |
testcase_26 | AC | 145 ms
107,064 KB |
testcase_27 | AC | 105 ms
86,568 KB |
ソースコード
N, K = map(int, input().split()) A = list(map(int, input().split())) order = [] minimum = 1 maximum = N i = 0 while i < N - 1: if A[i] < A[i + 1]: order.append(maximum) maximum -= 1 elif A[i] > A[i + 1]: order.append(minimum) minimum += 1 else: j = i + 1 while j < N - 1: if A[i] != A[j]: break j += 1 for _ in range(j - i): if A[i] < A[j]: order.append(maximum) maximum -= 1 else: order.append(minimum) minimum += 1 i = j i += 1 order.append(maximum) for i in range(N): if order[i] != K: print(f"{A[i]}", end = " ")