Educational Codeforces Round 75 D問題 - Salary Changing

Source

Educational Codeforces Round 75 D問題
Problem description

問題概要

省略

解法

省略

cLayversion 20191108-1)のコード

C++に変換後のコードはこちら

//no-unlocked
int N; ll S; int L[2d5], R[2d5];
{
  ll rem;
  int ok, res;
  REP(rd_int()){
    rd(N,S,(L,R)(N));
    sortA(N,L,R);
    rep(i,N) S -= L[i];
    res = bsearch_max[int,x,0,1d9][
      rem = S;
      ok = 0;
      rrep(i,N){
        if(L[i] >= x) ok++, continue;
        if(R[i] < x) continue;
        if(rem >= x - L[i]) ok++, rem -= x - L[i];
      }
    ](ok >= (N+1)/2);
    wt(res);
  }
}

Current time: 2024年04月25日07時54分04秒
Last modified: 2019年11月10日18時55分50秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces
トップページに戻る

Logged in as: unknown user (not login)

ログイン: