結果

問題 No.1110 好きな歌
ユーザー oriekaorieka
提出日時 2020-07-10 23:40:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 372 ms / 5,000 ms
コード長 636 bytes
コンパイル時間 919 ms
コンパイル使用メモリ 108,028 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-20 00:26:23
合計ジャッジ時間 11,089 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 3 ms
6,944 KB
testcase_17 AC 3 ms
6,940 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 3 ms
6,944 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 3 ms
6,940 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 215 ms
6,944 KB
testcase_25 AC 250 ms
6,944 KB
testcase_26 AC 126 ms
6,940 KB
testcase_27 AC 239 ms
6,944 KB
testcase_28 AC 136 ms
6,944 KB
testcase_29 AC 286 ms
6,944 KB
testcase_30 AC 135 ms
6,940 KB
testcase_31 AC 82 ms
6,940 KB
testcase_32 AC 316 ms
6,940 KB
testcase_33 AC 158 ms
6,940 KB
testcase_34 AC 236 ms
6,944 KB
testcase_35 AC 325 ms
6,940 KB
testcase_36 AC 39 ms
6,940 KB
testcase_37 AC 96 ms
6,944 KB
testcase_38 AC 299 ms
6,940 KB
testcase_39 AC 212 ms
6,944 KB
testcase_40 AC 258 ms
6,940 KB
testcase_41 AC 21 ms
6,944 KB
testcase_42 AC 297 ms
6,940 KB
testcase_43 AC 284 ms
6,944 KB
testcase_44 AC 340 ms
6,940 KB
testcase_45 AC 357 ms
6,940 KB
testcase_46 AC 344 ms
6,940 KB
testcase_47 AC 345 ms
6,940 KB
testcase_48 AC 339 ms
6,940 KB
testcase_49 AC 311 ms
6,940 KB
testcase_50 AC 333 ms
6,940 KB
testcase_51 AC 346 ms
6,944 KB
testcase_52 AC 341 ms
6,944 KB
testcase_53 AC 372 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9 + 7);

int main(void) {
	int n, d;
	cin >> n >> d;
	
	vector<int> a(n), tmp;
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	
	tmp = a;
	sort(tmp.begin(), tmp.end());

	for(auto& x : a) {
		int ans = upper_bound(tmp.begin(), tmp.end(), x - d) - tmp.begin();
		cout << ans << endl;
	}
	
	return 0;
}
0