結果
| 問題 |
No.3252 Constrained Moving
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-05 21:37:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 402 bytes |
| コンパイル時間 | 240 ms |
| コンパイル使用メモリ | 82,744 KB |
| 実行使用メモリ | 136,756 KB |
| 最終ジャッジ日時 | 2025-09-05 21:37:22 |
| 合計ジャッジ時間 | 9,817 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 WA * 3 |
ソースコード
N,S,T,K=(int(x) for x in input().split())
A=list(map(int, input().split()))
if A[S-1] + A[T-1] <= K:
print(1)
exit()
a = A[T-1]
res=[]
for i in range(1, N+1):
res.append([A[i-1], i])
res = sorted(res, key=lambda x: x[0])
if min(A) == a:
if a + res[1][0] <= K:
print(2)
else:
print(-1)
else:
if res[0][0] + a <= K:
print(2)
else:
print(-1)