結果

問題 No.3252 Constrained Moving
ユーザー miztom
提出日時 2025-09-06 02:10:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 151 bytes
コンパイル時間 487 ms
コンパイル使用メモリ 82,032 KB
実行使用メモリ 107,888 KB
最終ジャッジ日時 2025-09-06 02:11:00
合計ジャッジ時間 5,280 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

n,s,t,k=map(int,input().split())
a=[*map(int,input().split())];m=min(a)
if a[s-1]+a[t-1]<=k:print(1)
elif m+a[s-1]<=k>=m+a[t-1]:print(2)
else:print(-1)
0