保存されている過去のバージョンの一覧

2020年12月05日16時07分53秒

Codeforces Round #686 DIV3 C問題 - Sequence Transformation

Source

Codeforces Round #686 DIV3 C問題
Problem description

問題概要

省略

解法

省略

cLayversion 20201205-1)のコード

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

//no-unlocked
int N, A[2d5], hist[2d5];
{
  REP(rd_int()){
    int res = int_inf, k = 0, tmp;
    rd(N,(A--)(N));
    rep(i,N) if(k==0 || A[k-1] != A[i]) A[k++] = A[i];
    rep(i,N) hist[i] = 0;
    rep(i,k) hist[A[i]]++;
    rep(i,N) if(hist[i]){
      tmp = hist[i] + 1;
      if(A[0]==i) tmp--;
      if(A[k-1]==i) tmp--;
      res <?= tmp;
    }
    wt(res);
  }
}

Current time: 2024年04月26日07時59分16秒
Last modified: 2020年12月05日16時07分53秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF686 CF_DIV3_C
トップページに戻る

Logged in as: unknown user (not login)

ログイン: