結果

問題 No.1110 好きな歌
ユーザー mfbgjsczmfbgjscz
提出日時 2020-07-10 21:42:13
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 309 ms / 5,000 ms
コード長 1,592 bytes
コンパイル時間 2,541 ms
コンパイル使用メモリ 202,512 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2024-04-19 16:29:04
合計ジャッジ時間 11,384 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 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 1 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 1 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 3 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 3 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 166 ms
5,376 KB
testcase_25 AC 212 ms
5,504 KB
testcase_26 AC 105 ms
5,376 KB
testcase_27 AC 203 ms
5,632 KB
testcase_28 AC 123 ms
5,376 KB
testcase_29 AC 241 ms
5,888 KB
testcase_30 AC 113 ms
5,376 KB
testcase_31 AC 73 ms
5,376 KB
testcase_32 AC 264 ms
6,272 KB
testcase_33 AC 135 ms
5,376 KB
testcase_34 AC 193 ms
5,376 KB
testcase_35 AC 291 ms
6,528 KB
testcase_36 AC 30 ms
5,376 KB
testcase_37 AC 78 ms
5,376 KB
testcase_38 AC 237 ms
5,760 KB
testcase_39 AC 180 ms
5,376 KB
testcase_40 AC 223 ms
5,888 KB
testcase_41 AC 17 ms
5,376 KB
testcase_42 AC 253 ms
6,144 KB
testcase_43 AC 237 ms
5,888 KB
testcase_44 AC 282 ms
6,400 KB
testcase_45 AC 295 ms
6,400 KB
testcase_46 AC 304 ms
6,400 KB
testcase_47 AC 304 ms
6,528 KB
testcase_48 AC 292 ms
6,528 KB
testcase_49 AC 281 ms
6,400 KB
testcase_50 AC 302 ms
6,528 KB
testcase_51 AC 303 ms
6,528 KB
testcase_52 AC 295 ms
6,528 KB
testcase_53 AC 309 ms
6,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
*/#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")    
using namespace std;
/*namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;
using Real = mp::number<mp::cpp_dec_float<1024>>;
*/#define lli long long int
#define uli unsigned long long int
#define INF 999999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(50) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 998244353
#define MAX 10000000
#define ALL(a)  a.begin(),a.end()
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  lli A,B,C,D,E,H,W,M,K,L,R,N,num=0,sum=0,flag=0;string S,T;
  cin >> N >> D;
  Vec(P,lli,N,0);
  rep(i,0,N)cin >> P[i];
  vector<lli>Q=P;
  Sort(Q);
  rep(i,0,N){
    int ok=-1,ng=N;
    while(ng-ok>1){
      int mid=(ok+ng)/2;
      if(Q[mid]+D<=P[i])ok=mid;
      else ng=mid;
    }
    Out(ok+1);
  }
}
0