結果

問題 No.1110 好きな歌
ユーザー momoyuumomoyuu
提出日時 2022-08-18 17:13:53
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 411 ms / 5,000 ms
コード長 857 bytes
コンパイル時間 4,193 ms
コンパイル使用メモリ 280,584 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2024-04-16 01:22:38
合計ジャッジ時間 15,128 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 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 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 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 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 3 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 4 ms
5,376 KB
testcase_20 AC 4 ms
5,376 KB
testcase_21 AC 3 ms
5,376 KB
testcase_22 AC 3 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 226 ms
5,376 KB
testcase_25 AC 278 ms
5,504 KB
testcase_26 AC 145 ms
5,376 KB
testcase_27 AC 270 ms
5,376 KB
testcase_28 AC 155 ms
5,376 KB
testcase_29 AC 331 ms
5,888 KB
testcase_30 AC 151 ms
5,376 KB
testcase_31 AC 95 ms
5,376 KB
testcase_32 AC 362 ms
6,144 KB
testcase_33 AC 172 ms
5,376 KB
testcase_34 AC 238 ms
5,376 KB
testcase_35 AC 362 ms
6,272 KB
testcase_36 AC 40 ms
5,376 KB
testcase_37 AC 105 ms
5,376 KB
testcase_38 AC 319 ms
5,760 KB
testcase_39 AC 238 ms
5,376 KB
testcase_40 AC 293 ms
5,760 KB
testcase_41 AC 24 ms
5,376 KB
testcase_42 AC 333 ms
6,016 KB
testcase_43 AC 325 ms
5,888 KB
testcase_44 AC 371 ms
6,528 KB
testcase_45 AC 388 ms
6,400 KB
testcase_46 AC 377 ms
6,528 KB
testcase_47 AC 405 ms
6,528 KB
testcase_48 AC 389 ms
6,400 KB
testcase_49 AC 363 ms
6,528 KB
testcase_50 AC 388 ms
6,400 KB
testcase_51 AC 373 ms
6,528 KB
testcase_52 AC 385 ms
6,400 KB
testcase_53 AC 411 ms
6,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
template<class t> using vc = vector<t>;
template<class t> using vvc = vc<vc<t>>;
using pi = pair<int,int>;
using vi = vc<int>;
using vvi = vvc<int>;

#define rep(i,a,b) for (int i = a; i < b; i++)
#define irep(i,a,b) for (int i = a; i > b; i--)
#define print(n) cout << n << endl
#define rup(a,b) (a+b-1)/b
#define input(A,N) rep(i,0,N) cin>>A[i];


int main(){
    cout << fixed << setprecision(15);
    
    ll N,D;

    cin>>N>>D;
    vc<ll> A(N);
    input(A,N);

    vc<ll> B(N);
    //copy(A.begin(),A.end(),B.begin());
    rep(i,0,N){
        B[i] = A[i];
    }
    sort(B.begin(),B.end());
    rep(i,0,N){
        print(distance(B.begin(),upper_bound(B.begin(),B.end(),A[i]-D)));
    }
    //system("pause");
    return 0;
}
0