結果

問題 No.1110 好きな歌
ユーザー fastmathfastmath
提出日時 2020-07-10 21:34:51
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 90 ms / 5,000 ms
コード長 809 bytes
コンパイル時間 2,137 ms
コンパイル使用メモリ 169,600 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-04-19 15:59:48
合計ジャッジ時間 6,538 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 3 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 3 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 2 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 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 49 ms
5,380 KB
testcase_25 AC 54 ms
6,472 KB
testcase_26 AC 29 ms
5,376 KB
testcase_27 AC 55 ms
6,456 KB
testcase_28 AC 30 ms
5,376 KB
testcase_29 AC 72 ms
6,892 KB
testcase_30 AC 26 ms
5,376 KB
testcase_31 AC 17 ms
5,376 KB
testcase_32 AC 78 ms
6,940 KB
testcase_33 AC 28 ms
5,376 KB
testcase_34 AC 41 ms
5,452 KB
testcase_35 AC 59 ms
6,940 KB
testcase_36 AC 8 ms
5,376 KB
testcase_37 AC 23 ms
5,376 KB
testcase_38 AC 73 ms
6,620 KB
testcase_39 AC 52 ms
5,376 KB
testcase_40 AC 45 ms
6,716 KB
testcase_41 AC 6 ms
5,376 KB
testcase_42 AC 56 ms
6,872 KB
testcase_43 AC 69 ms
6,624 KB
testcase_44 AC 65 ms
6,832 KB
testcase_45 AC 76 ms
6,912 KB
testcase_46 AC 73 ms
6,912 KB
testcase_47 AC 90 ms
7,040 KB
testcase_48 AC 79 ms
6,912 KB
testcase_49 AC 55 ms
6,912 KB
testcase_50 AC 77 ms
7,040 KB
testcase_51 AC 69 ms
7,168 KB
testcase_52 AC 76 ms
7,036 KB
testcase_53 AC 88 ms
6,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
#define debug(x) std::cout << #x << ": " << x << '\n';
signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    #define endl '\n'
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif
    int n, d;
    cin >> n >> d;
    vector <int> a(n);
    vector <int> c;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        c.app(a[i]);
    }        
    sort(all(c));

    for (int i = 0; i < n; ++i) {
        cout << upper_bound(all(c), a[i]-d) - c.begin() << endl;
    }   
}
0