Codeforces Round #580 DIV1 B問題 (750pt)
Codeforces Round #580 DIV2 D問題 (1750pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N; ll A[1d5];
int cnt[63];
int m, u[200], v[200];
{
int i, j, k, res;
ll x;
graph g;
rd(k);
rep(k){
rd(x);
if(x) A[N++] = x;
}
rep(i,N) rep(j,63) if(A[i] & (1LL<<j)) cnt[j]++;
rep(i,63) if(cnt[i] >= 3){ wt(3); return 0; }
rep(i,N) rep(j,i+1,N) if(A[i]&A[j]) u[m] = i, v[m++] = j;
g.setEdge(N, m, u, v);
res = g.shortestUndirectedCycle_length();
wt(res);
}
Current time: 2024年04月19日21時38分45秒
Last modified: 2019年08月21日05時10分07秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF580 CF_Div1_B CF_Div2_D
トップページに戻る
Logged in as: unknown user (not login)