結果

問題 No.1110 好きな歌
ユーザー rokahikou1rokahikou1
提出日時 2020-07-10 22:08:25
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 379 ms / 5,000 ms
コード長 851 bytes
コンパイル時間 1,129 ms
コンパイル使用メモリ 100,068 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 17:18:50
合計ジャッジ時間 12,054 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 3 ms
5,376 KB
testcase_17 AC 3 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 3 ms
5,376 KB
testcase_20 AC 3 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 212 ms
5,376 KB
testcase_25 AC 261 ms
5,376 KB
testcase_26 AC 133 ms
5,376 KB
testcase_27 AC 257 ms
5,376 KB
testcase_28 AC 147 ms
5,376 KB
testcase_29 AC 311 ms
5,376 KB
testcase_30 AC 141 ms
5,376 KB
testcase_31 AC 87 ms
5,376 KB
testcase_32 AC 339 ms
5,376 KB
testcase_33 AC 165 ms
5,376 KB
testcase_34 AC 244 ms
5,376 KB
testcase_35 AC 345 ms
5,376 KB
testcase_36 AC 40 ms
5,376 KB
testcase_37 AC 100 ms
5,376 KB
testcase_38 AC 320 ms
5,376 KB
testcase_39 AC 222 ms
5,376 KB
testcase_40 AC 288 ms
5,376 KB
testcase_41 AC 23 ms
5,376 KB
testcase_42 AC 317 ms
5,376 KB
testcase_43 AC 319 ms
5,376 KB
testcase_44 AC 355 ms
5,376 KB
testcase_45 AC 363 ms
5,376 KB
testcase_46 AC 359 ms
5,376 KB
testcase_47 AC 379 ms
5,376 KB
testcase_48 AC 376 ms
5,376 KB
testcase_49 AC 343 ms
5,376 KB
testcase_50 AC 370 ms
5,376 KB
testcase_51 AC 359 ms
5,376 KB
testcase_52 AC 369 ms
5,376 KB
testcase_53 AC 371 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    int N, D;
    cin >> N >> D;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    auto sorted = A;
    sort(All(sorted));
    rep(i, N) {
        cout << lower_bound(All(sorted), A[i] - D + 1) - sorted.begin() << endl;
    }
    return 0;
}
0