Educational Codeforces Round 77 D問題 - A Game with Traps

Source

Educational Codeforces Round 77 D問題
Problem description

問題概要

省略

解法

省略

cLayversion 20200214-1)のコード

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

//no-unlocked
int M, N, K, T, A[2d5];
int L[2d5], R[2d5], D[2d5];
{
  int res, agi, p, nx, t;
  rd(M,N,K,T,A(M),(L,R,D)(K));
  sortF(M,A);
  sortA(K,L,R,D);

  res = bsearch_max[int,x,0,M][
    agi = A[M-x];
    t = p = 0;
    rep(i,K) if(D[i] > agi){
      t += (L[i] - 1) - p;
      p = L[i] - 1;
      nx = R[i];
      while(i+1 < K && nx >= L[i+1]){
        i++;
        if(D[i] > agi) nx >?= R[i];
      }
      t += 3 * (nx - p);
      p = nx;
    }
    t += N + 1- p;
  ](t <= T);
  wt(res);
}

Current time: 2024年04月25日15時51分56秒
Last modified: 2020年02月16日15時09分55秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces
トップページに戻る

Logged in as: unknown user (not login)

ログイン: