結果
問題 |
No.2803 Bocching Star
|
ユーザー |
|
提出日時 | 2024-07-12 21:44:47 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 638 bytes |
コンパイル時間 | 2,144 ms |
コンパイル使用メモリ | 200,420 KB |
最終ジャッジ日時 | 2025-02-22 03:46:19 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 35 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { int n, s; cin >> n >> s; vector<pair<int, int>> a(n); for (int i = 0; i < n; i++){ cin >> a[i].first; a[i].second = i; } sort(a.begin(), a.end()); for (int i = 0; i < n; i++) { if (i == 0) { if (a[i + 1].first - a[i].first > s) { cout << a[i].second + 1 << ' '; } } else if (i != n - 1) { if (a[i + 1].first - a[i].first > s) { if (a[i].first - a[i - 1].first > s) { cout << a[i].second + 1 << ' '; } } } else { if (a[i].first - a[i - 1].first > s) { cout << a[i].second + 1 << ' '; } } } }