結果
| 問題 |
No.3252 Constrained Moving
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-05 22:04:08 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 487 bytes |
| コンパイル時間 | 1,438 ms |
| コンパイル使用メモリ | 168,288 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-09-05 22:04:12 |
| 合計ジャッジ時間 | 4,021 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 WA * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
int main(void){
cin.tie(nullptr); ios_base::sync_with_stdio(false);
ll i,j;
ll N,S,T,K;
cin >> N >> S >> T >> K;
vector<ll> a(N);
REP(i,N) cin >> a[i];
ll p=a[S-1],q=a[T-1];
sort(a.begin(),a.end());
if(p+q<=K) cout << 1 << endl;
if(a[0]+p<=K && a[0]+q<=K) cout << 2 << endl;
else cout << -1 << endl;
return 0;
}