結果

問題 No.3252 Constrained Moving
ユーザー lif4635
提出日時 2025-09-05 05:03:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 357 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 82,660 KB
実行使用メモリ 107,984 KB
最終ジャッジ日時 2025-09-05 16:35:19
合計ジャッジ時間 4,438 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 15 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

"""
嘘 1 
"""
n, s, t, k = map(int, input().split())
a = list(map(int, input().split()))

assert 1 <= n <= 2 * 10 ** 5
assert 1 <= s <= n
assert 1 <= t <= n
assert s != t
assert 1 <= k <= 10 ** 9

for x in a:
    assert 1 <= x <= 10 ** 9

s -= 1
t -= 1

if a[s] + a[t] <= k:
    print(1)
elif max(a) + min(a[s], a[t]) <= k:
    print(2)
else:
    print(-1)
0