Educational Codeforces Round 101 C問題 - Building a Fence

Source

Educational Codeforces Round 101 C問題
Problem description

問題概要

省略

解法

省略

cLayversion 20201229-1)のコード

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

//no-unlocked
int N, K, A[2d5];
{
  REP(rd_int()){
    int mn, mx;
    rd(N,K,A(N));
    mn = mx = A[0];
    rep(i,1,N){
      (mn, mx) = (max(A[i], mn - K + 1),  min(A[i] + K - 1, mx + K - 1));
      if(mn > mx) wt("NO"), break_continue;
    }
    wt(if[mn==A[N-1], "YES", "NO"]);
  }
}

Current time: 2024年03月29日10時32分05秒
Last modified: 2020年12月29日16時15分12秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces
トップページに戻る

Logged in as: unknown user (not login)

ログイン: