結果

問題 No.1110 好きな歌
ユーザー kk
提出日時 2020-07-29 04:32:19
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 331 ms / 5,000 ms
コード長 388 bytes
コンパイル時間 2,819 ms
コンパイル使用メモリ 204,120 KB
実行使用メモリ 4,748 KB
最終ジャッジ日時 2023-09-11 07:07:43
合計ジャッジ時間 13,152 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,384 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 3 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 3 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 3 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 190 ms
4,376 KB
testcase_25 AC 230 ms
4,376 KB
testcase_26 AC 121 ms
4,384 KB
testcase_27 AC 222 ms
4,380 KB
testcase_28 AC 131 ms
4,376 KB
testcase_29 AC 271 ms
4,380 KB
testcase_30 AC 128 ms
4,380 KB
testcase_31 AC 79 ms
4,376 KB
testcase_32 AC 296 ms
4,388 KB
testcase_33 AC 142 ms
4,380 KB
testcase_34 AC 195 ms
4,384 KB
testcase_35 AC 300 ms
4,604 KB
testcase_36 AC 34 ms
4,380 KB
testcase_37 AC 90 ms
4,380 KB
testcase_38 AC 268 ms
4,376 KB
testcase_39 AC 196 ms
4,380 KB
testcase_40 AC 242 ms
4,384 KB
testcase_41 AC 20 ms
4,384 KB
testcase_42 AC 280 ms
4,416 KB
testcase_43 AC 270 ms
4,384 KB
testcase_44 AC 311 ms
4,652 KB
testcase_45 AC 315 ms
4,612 KB
testcase_46 AC 315 ms
4,656 KB
testcase_47 AC 331 ms
4,672 KB
testcase_48 AC 316 ms
4,748 KB
testcase_49 AC 293 ms
4,548 KB
testcase_50 AC 318 ms
4,544 KB
testcase_51 AC 312 ms
4,596 KB
testcase_52 AC 321 ms
4,600 KB
testcase_53 AC 329 ms
4,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(int i=0; i<(int)(n); i++)

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n, d;
  cin >> n >> d;

  vector<int> a(n);
  REP (i, n) cin >> a[i];

  vector<int> b = a;
  sort(b.begin(), b.end());

  REP (i, n)
    cout << upper_bound(b.begin(), b.end(), a[i] - d) - b.begin() << endl;
  
  return 0;
}
0