Codeforces Round #686 DIV3 C問題
Problem description
省略
省略
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月27日02時43分50秒
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)