結果

問題 No.1110 好きな歌
ユーザー ysystem7ysystem7
提出日時 2020-07-10 21:27:08
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 321 ms / 5,000 ms
コード長 2,130 bytes
コンパイル時間 2,138 ms
コンパイル使用メモリ 201,536 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-04-19 15:33:07
合計ジャッジ時間 11,729 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 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 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 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 2 ms
5,376 KB
testcase_17 AC 3 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 3 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 3 ms
5,376 KB
testcase_23 AC 3 ms
5,376 KB
testcase_24 AC 177 ms
5,376 KB
testcase_25 AC 218 ms
5,504 KB
testcase_26 AC 113 ms
5,376 KB
testcase_27 AC 224 ms
5,504 KB
testcase_28 AC 125 ms
5,376 KB
testcase_29 AC 264 ms
5,760 KB
testcase_30 AC 121 ms
5,376 KB
testcase_31 AC 77 ms
5,376 KB
testcase_32 AC 282 ms
6,016 KB
testcase_33 AC 136 ms
5,376 KB
testcase_34 AC 187 ms
5,376 KB
testcase_35 AC 290 ms
6,400 KB
testcase_36 AC 32 ms
5,376 KB
testcase_37 AC 88 ms
5,376 KB
testcase_38 AC 260 ms
5,632 KB
testcase_39 AC 195 ms
5,376 KB
testcase_40 AC 231 ms
5,760 KB
testcase_41 AC 18 ms
5,376 KB
testcase_42 AC 260 ms
6,016 KB
testcase_43 AC 254 ms
5,888 KB
testcase_44 AC 294 ms
6,272 KB
testcase_45 AC 321 ms
6,272 KB
testcase_46 AC 321 ms
6,400 KB
testcase_47 AC 317 ms
6,272 KB
testcase_48 AC 303 ms
6,272 KB
testcase_49 AC 272 ms
6,400 KB
testcase_50 AC 308 ms
6,400 KB
testcase_51 AC 295 ms
6,400 KB
testcase_52 AC 300 ms
6,272 KB
testcase_53 AC 321 ms
6,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define LB(a,x) lb(all(a),x)-a.begin()
#define UB(a,x) ub(all(a),x)-a.begin()
#define mod 1000000007
#define FS fixed<<setprecision(15)
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<n;i++)
const double pi=3.141592653589793;
template<class T> using V=vector<T>;
using Graph = vector<vector<int>>;
using P=pair<ll,ll>;
typedef unsigned long long ull;
typedef long double ldouble;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

const ll INF=1e18;

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    ll n,d;
    cin>>n>>d;
    V<ll> a(n),b(n);
    rep(i,n){
        cin>>a[i];
        b[i]=a[i]+d;
    }
    sort(all(b));
    rep(i,n){
        ll x=ub(all(b),a[i])-b.begin();
        cout<<x<<endl;
    }
}
//ペナルティ出しても焦らない ACできると信じろ!!!
//どうしてもわからないときはサンプルで実験 何か見えてくるかも
//頭で考えてダメなら紙におこせ!!
/*
V,P(大文字)使用不可
乗算などの際にオーバーフローに注意せよ!
(適切にmodをとれ にぶたんで途中で切り上げろ)
制約をよく読め!
{
    ・全探索できるなら全探索しろ
    ・異常な制約ならそこに注目
}
stringの計算量(扱い)注意
コーナー注意!(特に数値が小さいものについては要検証)
N行出力のときは'¥n'
グリッド上では行先が範囲内におさまるかif文で確認(RE注意)
if文ではちゃんと比較演算子==を使え('='でもエラー出ない)
配列(vector)の大きさが0か1以上かで場合分けせよ(RE注意)
(vector<int> a(m)でm==0というものはできない)
modはなるべく最後に取れ!
doubleを扱うときには(abs)ではなく'fabs'!!!
*/
0