Codeforces Round #814 DIV2 C問題 - Fighting Tournament

Source

Codeforces Round #814 DIV2 C問題 (1250pt)
Problem description

問題概要

省略

解法

省略

cLay(version 20221122-1)のコード

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

//no-unlocked
REP(rd_int()){
  int @N, @Q, @A[N], ok[N] = {}, nx[N], mx = -1;
  rep(i,N) if(A[i] > mx) ok[i] = 1, mx = A[i];
  rrep(i,N){
    nx[i] = mx;
    if(ok[i]) mx = i;
  }
  if(A[0] < A[1]) ok[0] = 0;
  rep(Q){
    int @I--, @K, f;
    f = max(0, K - max(0, I-1));
    if(A[I]==N) wt(f), continue;
    if(ok[I]==0) wt(0), continue;
    f <?= nx[I] - max(0, I-1) - 1;
    wt(f);
  }
}

Current time: 2024年05月06日00時17分36秒
Last modified: 2022年12月30日21時58分08秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF814 CF_DIV2_C
トップページに戻る

Logged in as: unknown user (not login)

ログイン: