結果

問題 No.3252 Constrained Moving
ユーザー cologne
提出日時 2025-09-06 14:13:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 82,108 KB
実行使用メモリ 109,324 KB
最終ジャッジ日時 2025-09-06 14:13:13
合計ジャッジ時間 5,692 ms
ジャッジサーバーID
(参考情報)
judge / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #


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


if __name__ == "__main__":
    main()
0