結果

問題 No.1110 好きな歌
ユーザー root__786root__786
提出日時 2020-07-10 23:27:41
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 260 ms / 5,000 ms
コード長 696 bytes
コンパイル時間 2,510 ms
コンパイル使用メモリ 208,536 KB
実行使用メモリ 14,336 KB
最終ジャッジ日時 2024-04-20 00:03:12
合計ジャッジ時間 10,663 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,812 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,948 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 1 ms
6,944 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 2 ms
6,944 KB
testcase_18 AC 1 ms
6,940 KB
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 3 ms
6,940 KB
testcase_21 AC 2 ms
6,940 KB
testcase_22 AC 3 ms
6,944 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 140 ms
9,728 KB
testcase_25 AC 181 ms
11,136 KB
testcase_26 AC 92 ms
7,296 KB
testcase_27 AC 168 ms
11,136 KB
testcase_28 AC 91 ms
7,680 KB
testcase_29 AC 208 ms
12,288 KB
testcase_30 AC 88 ms
7,808 KB
testcase_31 AC 50 ms
6,944 KB
testcase_32 AC 229 ms
13,312 KB
testcase_33 AC 103 ms
8,576 KB
testcase_34 AC 146 ms
10,240 KB
testcase_35 AC 241 ms
14,080 KB
testcase_36 AC 21 ms
6,944 KB
testcase_37 AC 57 ms
6,944 KB
testcase_38 AC 203 ms
12,032 KB
testcase_39 AC 144 ms
9,984 KB
testcase_40 AC 181 ms
11,904 KB
testcase_41 AC 12 ms
6,940 KB
testcase_42 AC 215 ms
13,056 KB
testcase_43 AC 195 ms
12,160 KB
testcase_44 AC 250 ms
14,336 KB
testcase_45 AC 259 ms
14,208 KB
testcase_46 AC 251 ms
14,208 KB
testcase_47 AC 257 ms
14,336 KB
testcase_48 AC 260 ms
14,336 KB
testcase_49 AC 243 ms
14,208 KB
testcase_50 AC 258 ms
14,336 KB
testcase_51 AC 251 ms
14,208 KB
testcase_52 AC 249 ms
14,336 KB
testcase_53 AC 250 ms
14,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll int
bool find(vector<int> b){
    for(int i=0;i<b.size();i++){
        b[i]=b[i]%12;
    }
    sort(b.begin(),b.end());
    vector<int> aa={0,2,4,5,7,9,11};
   
    for(int i=0;i<b.size();i++){
        for(int j=0;j<aa.size();j++)
        if(b[i]==aa[j]) return true;
    }
    return false;
    
}
int main() {
   ll n,d;
   cin>>n>>d;
   vector<int> A(n);
   for(ll i=0;i<n;i++) cin>>A[i];
    vector<int> aa = A;
    sort(A.begin(),A.end());

    map<int, int> mp;
    for (auto a : A) mp[a] =  upper_bound(A.begin(),A.end(), a - d) - A.begin();
    for (auto a : aa)
    {
        cout << mp[a] << '\n';
    }
   
}
0