結果

問題 No.3252 Constrained Moving
ユーザー titia
提出日時 2025-09-06 01:36:01
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 205 bytes
コンパイル時間 570 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 32,324 KB
最終ジャッジ日時 2025-09-06 01:36:07
合計ジャッジ時間 5,208 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 12 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

N,S,T,K=map(int,input().split())
A=list(map(int,input().split()))

S-=1
T-=1

if A[S-1]+A[T-1]<=K:
    print(1)
    exit()

MIN=min(A)

if A[S-1]+MIN<=K and A[T-1]+MIN<=K:
    print(2)
else:
    print(-1)
0