結果

問題 No.1110 好きな歌
ユーザー milanis48663220milanis48663220
提出日時 2020-07-10 21:38:36
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 297 ms / 5,000 ms
コード長 568 bytes
コンパイル時間 1,054 ms
コンパイル使用メモリ 85,584 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 16:17:38
合計ジャッジ時間 9,794 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 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 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 3 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 3 ms
5,376 KB
testcase_20 AC 3 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 163 ms
5,376 KB
testcase_25 AC 197 ms
5,376 KB
testcase_26 AC 109 ms
5,376 KB
testcase_27 AC 199 ms
5,376 KB
testcase_28 AC 118 ms
5,376 KB
testcase_29 AC 241 ms
5,376 KB
testcase_30 AC 110 ms
5,376 KB
testcase_31 AC 72 ms
5,376 KB
testcase_32 AC 268 ms
5,376 KB
testcase_33 AC 127 ms
5,376 KB
testcase_34 AC 179 ms
5,376 KB
testcase_35 AC 263 ms
5,376 KB
testcase_36 AC 30 ms
5,376 KB
testcase_37 AC 96 ms
5,376 KB
testcase_38 AC 234 ms
5,376 KB
testcase_39 AC 175 ms
5,376 KB
testcase_40 AC 213 ms
5,376 KB
testcase_41 AC 18 ms
5,376 KB
testcase_42 AC 245 ms
5,376 KB
testcase_43 AC 241 ms
5,376 KB
testcase_44 AC 287 ms
5,376 KB
testcase_45 AC 282 ms
5,376 KB
testcase_46 AC 283 ms
5,376 KB
testcase_47 AC 296 ms
5,376 KB
testcase_48 AC 292 ms
5,376 KB
testcase_49 AC 277 ms
5,376 KB
testcase_50 AC 291 ms
5,376 KB
testcase_51 AC 281 ms
5,376 KB
testcase_52 AC 292 ms
5,376 KB
testcase_53 AC 297 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int N, D;
int A[200000];
int B[200000];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    cin >> N >> D;
    for(int i = 0; i < N; i++) {
        cin >> A[i];
        B[i] = A[i];
    }
    sort(B, B+N);
    for(int i = 0; i < N; i++){
        auto p = upper_bound(B, B+N, A[i]-D);
        cout << p-B << endl;
    }
}
0