結果

問題 No.1110 好きな歌
ユーザー NoviNovi
提出日時 2020-07-11 14:19:06
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 335 ms / 5,000 ms
コード長 816 bytes
コンパイル時間 1,598 ms
コンパイル使用メモリ 172,180 KB
実行使用メモリ 7,856 KB
最終ジャッジ日時 2023-08-03 03:29:08
合計ジャッジ時間 11,976 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 3 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 3 ms
4,380 KB
testcase_20 AC 3 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 182 ms
5,496 KB
testcase_25 AC 227 ms
7,196 KB
testcase_26 AC 120 ms
5,124 KB
testcase_27 AC 229 ms
7,232 KB
testcase_28 AC 128 ms
5,024 KB
testcase_29 AC 267 ms
7,384 KB
testcase_30 AC 126 ms
5,128 KB
testcase_31 AC 79 ms
4,384 KB
testcase_32 AC 305 ms
7,416 KB
testcase_33 AC 142 ms
5,348 KB
testcase_34 AC 196 ms
5,648 KB
testcase_35 AC 294 ms
7,644 KB
testcase_36 AC 34 ms
4,380 KB
testcase_37 AC 86 ms
4,472 KB
testcase_38 AC 267 ms
7,448 KB
testcase_39 AC 198 ms
5,652 KB
testcase_40 AC 234 ms
7,216 KB
testcase_41 AC 20 ms
4,380 KB
testcase_42 AC 268 ms
7,508 KB
testcase_43 AC 257 ms
7,380 KB
testcase_44 AC 308 ms
7,744 KB
testcase_45 AC 314 ms
7,656 KB
testcase_46 AC 308 ms
7,656 KB
testcase_47 AC 332 ms
7,856 KB
testcase_48 AC 323 ms
7,756 KB
testcase_49 AC 292 ms
7,680 KB
testcase_50 AC 311 ms
7,712 KB
testcase_51 AC 311 ms
7,836 KB
testcase_52 AC 323 ms
7,740 KB
testcase_53 AC 335 ms
7,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long n,d;
    cin>>n>>d;
    vector<long long>a(0);
    for(int i=0; i<n; i++){
        long long aa; cin>>aa;
        a.emplace_back(aa);
    }
    vector<long long>b(0);
    for(int i=0; i<n; i++){
        b.emplace_back((d+a[i])*(-1));
    }
    sort(b.begin(), b.end());
    for(int i=0; i<n; i++){
        long long cnt= a[i]*(-1);
        auto ans=lower_bound(b.begin(), b.end(), cnt);
        cout<<n-distance(b.begin(),ans)<<endl;
    }

    return 0;
}
0