結果
| 問題 |
No.2803 Bocching Star
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-12 21:52:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 824 bytes |
| コンパイル時間 | 1,822 ms |
| コンパイル使用メモリ | 177,716 KB |
| 実行使用メモリ | 8,712 KB |
| 最終ジャッジ日時 | 2024-07-12 21:52:54 |
| 合計ジャッジ時間 | 6,060 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 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());
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());
cout << (int)ans.size() << '\n';
for (auto x : ans) {
cout << x + 1 << ' ';
}
}