Codeforces Good Bye 2021: 2022 is NEAR C問題 - Representative Edges

Source

Codeforces Good Bye 2021: 2022 is NEAR C問題 (1500pt)
Problem description

問題概要

省略

解法

省略

cLay(version 20211231-1)のコード

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

//no-unlocked
REP(rd_int()){
  int @N, @A[N], res = min(2,N), tmp, x, y;
  rep(i,N) rep(j,i+1,N){
    tmp = 0;
    rep(k,N){
      x = (A[j] - A[i]) * (k - i);
      y = j - i;
      if(x%y==0 && A[i] + x/y == A[k]) tmp++;
    }
    res >?= tmp;
  }
  wt(N - res);
}

Current time: 2024年05月19日05時11分42秒
Last modified: 2021年12月31日18時01分32秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces Codeforces_Good_Bye_2021
トップページに戻る

Logged in as: unknown user (not login)

ログイン: