結果

問題 No.3252 Constrained Moving
ユーザー shimon
提出日時 2025-09-30 22:31:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 82,668 KB
実行使用メモリ 107,916 KB
最終ジャッジ日時 2025-09-30 22:31:19
合計ジャッジ時間 6,952 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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