結果

問題 No.2803 Bocching Star
ユーザー mkawa2mkawa2
提出日時 2024-07-12 21:05:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 456 ms / 2,000 ms
コード長 1,108 bytes
コンパイル時間 857 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 124,952 KB
最終ジャッジ日時 2024-07-12 21:06:27
合計ジャッジ時間 10,678 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,480 KB
testcase_01 AC 34 ms
52,352 KB
testcase_02 AC 35 ms
52,608 KB
testcase_03 AC 80 ms
81,664 KB
testcase_04 AC 284 ms
105,744 KB
testcase_05 AC 161 ms
93,568 KB
testcase_06 AC 62 ms
72,320 KB
testcase_07 AC 129 ms
85,760 KB
testcase_08 AC 103 ms
82,176 KB
testcase_09 AC 316 ms
107,672 KB
testcase_10 AC 456 ms
109,080 KB
testcase_11 AC 415 ms
105,088 KB
testcase_12 AC 118 ms
85,648 KB
testcase_13 AC 258 ms
103,336 KB
testcase_14 AC 221 ms
98,816 KB
testcase_15 AC 315 ms
105,344 KB
testcase_16 AC 185 ms
93,316 KB
testcase_17 AC 89 ms
81,408 KB
testcase_18 AC 71 ms
76,032 KB
testcase_19 AC 290 ms
103,048 KB
testcase_20 AC 189 ms
93,696 KB
testcase_21 AC 136 ms
89,216 KB
testcase_22 AC 141 ms
87,936 KB
testcase_23 AC 375 ms
110,164 KB
testcase_24 AC 398 ms
123,544 KB
testcase_25 AC 364 ms
116,560 KB
testcase_26 AC 387 ms
117,588 KB
testcase_27 AC 332 ms
111,536 KB
testcase_28 AC 363 ms
114,384 KB
testcase_29 AC 323 ms
111,452 KB
testcase_30 AC 371 ms
118,724 KB
testcase_31 AC 348 ms
110,260 KB
testcase_32 AC 369 ms
124,952 KB
testcase_33 AC 44 ms
64,128 KB
testcase_34 AC 46 ms
64,256 KB
testcase_35 AC 46 ms
64,524 KB
testcase_36 AC 59 ms
64,896 KB
testcase_37 AC 45 ms
64,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
# sys.set_int_max_str_digits(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
# inf = -1-(-1 << 31)
inf = -1-(-1 << 62)

md = 10**9+7
# md = 998244353

n,s=LI()
pp=LI()

if n==1:
    print(1)
    print(1)
    exit()

ans=set()
ii=sorted(range(n),key=lambda i:pp[i])
i,j=ii[0],ii[1]
if pp[j]-pp[i]>s:ans.add(i+1)
i,j=ii[-2],ii[-1]
if pp[j]-pp[i]>s:ans.add(j+1)
for i,j,k in zip(ii,ii[1:],ii[2:]):
    if pp[k]-pp[j]>s and pp[j]-pp[i]>s:ans.add(j+1)

print(len(ans))
ans=sorted(ans)
print(*ans)
0