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