結果

問題 No.1110 好きな歌
ユーザー umezoumezo
提出日時 2020-07-10 22:35:49
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 377 ms / 5,000 ms
コード長 364 bytes
コンパイル時間 2,079 ms
コンパイル使用メモリ 201,516 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-19 17:49:07
合計ジャッジ時間 12,866 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 1 ms
6,948 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,948 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,944 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 2 ms
6,940 KB
testcase_17 AC 2 ms
6,944 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 3 ms
6,944 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 3 ms
6,944 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 213 ms
6,944 KB
testcase_25 AC 259 ms
5,376 KB
testcase_26 AC 138 ms
5,376 KB
testcase_27 AC 250 ms
5,504 KB
testcase_28 AC 146 ms
5,376 KB
testcase_29 AC 315 ms
5,760 KB
testcase_30 AC 149 ms
5,376 KB
testcase_31 AC 94 ms
5,376 KB
testcase_32 AC 344 ms
6,144 KB
testcase_33 AC 159 ms
5,376 KB
testcase_34 AC 226 ms
5,376 KB
testcase_35 AC 347 ms
6,144 KB
testcase_36 AC 37 ms
5,376 KB
testcase_37 AC 102 ms
5,376 KB
testcase_38 AC 303 ms
5,888 KB
testcase_39 AC 222 ms
5,376 KB
testcase_40 AC 261 ms
5,632 KB
testcase_41 AC 21 ms
5,376 KB
testcase_42 AC 304 ms
6,144 KB
testcase_43 AC 302 ms
5,760 KB
testcase_44 AC 339 ms
6,400 KB
testcase_45 AC 355 ms
6,400 KB
testcase_46 AC 365 ms
6,272 KB
testcase_47 AC 377 ms
6,528 KB
testcase_48 AC 357 ms
6,400 KB
testcase_49 AC 336 ms
6,528 KB
testcase_50 AC 358 ms
6,400 KB
testcase_51 AC 357 ms
6,272 KB
testcase_52 AC 371 ms
6,400 KB
testcase_53 AC 377 ms
6,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

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

int main(){
  ll n,d;
  cin>>n>>d;
  
  vector<ll> A(n),B(n);
  rep(i,n) cin>>A[i];
  B=A;
  
  sort(ALL(B));
  rep(i,n){
    int m=B.end()-upper_bound(ALL(B),A[i]-d);
    cout<<n-m<<endl;
  }

  return 0;
}
0