結果

問題 No.1110 好きな歌
ユーザー Ricky_ponRicky_pon
提出日時 2020-07-10 21:36:41
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 95 ms / 5,000 ms
コード長 1,114 bytes
コンパイル時間 1,990 ms
コンパイル使用メモリ 200,192 KB
実行使用メモリ 6,788 KB
最終ジャッジ日時 2023-08-01 16:53:07
合計ジャッジ時間 6,885 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 48 ms
5,428 KB
testcase_25 AC 59 ms
5,684 KB
testcase_26 AC 33 ms
4,744 KB
testcase_27 AC 59 ms
5,976 KB
testcase_28 AC 32 ms
4,808 KB
testcase_29 AC 77 ms
6,100 KB
testcase_30 AC 29 ms
4,820 KB
testcase_31 AC 20 ms
4,380 KB
testcase_32 AC 81 ms
6,456 KB
testcase_33 AC 32 ms
4,964 KB
testcase_34 AC 48 ms
5,436 KB
testcase_35 AC 67 ms
6,648 KB
testcase_36 AC 9 ms
4,376 KB
testcase_37 AC 24 ms
4,388 KB
testcase_38 AC 77 ms
6,048 KB
testcase_39 AC 54 ms
5,412 KB
testcase_40 AC 53 ms
6,108 KB
testcase_41 AC 6 ms
4,380 KB
testcase_42 AC 64 ms
6,400 KB
testcase_43 AC 71 ms
6,112 KB
testcase_44 AC 73 ms
6,600 KB
testcase_45 AC 83 ms
6,684 KB
testcase_46 AC 79 ms
6,716 KB
testcase_47 AC 95 ms
6,596 KB
testcase_48 AC 84 ms
6,564 KB
testcase_49 AC 63 ms
6,636 KB
testcase_50 AC 83 ms
6,572 KB
testcase_51 AC 74 ms
6,764 KB
testcase_52 AC 83 ms
6,788 KB
testcase_53 AC 93 ms
6,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i))
#define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T> bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}
template<class T> T div_floor(T a, T b){
    if(b < 0) a *= -1, b *= -1;
    return a>=0 ? a/b : (a+1)/b-1;
}
template<class T> T div_ceil(T a, T b){
    if(b < 0) a *= -1, b *= -1;
    return a>0 ? (a-1)/b+1 : a/b;
}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod * mod;
constexpr int MAX = 200010;

int main(){
    int n; lint d;
    scanf("%d%lld", &n, &d);
    lint a[n], v[n];
    rep(i, n) scanf("%lld", &a[i]), v[i] = a[i];
    sort(v, v+n);
    rep(i, n){
        printf("%d\n", upper_bound(v, v+n, a[i]-d) - v);
    }
}
0