Codeforces Good Bye 2020 E問題 (1500pt)
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N; ll A[5d5];
int cnt[60];
{
Comb<Modint> c;
REP(rd_int()){
Modint res = 0, t1, t2;
rd(N,A(N));
rep(j,60) cnt[j] = 0;
rep(i,N) rep(j,60) if(A[i] & (1LL<<j)) cnt[j]++;
rep(i,N){
t1 = t2 = 0;
rep(j,60){
if(A[i] & (1LL<<j)){
t1 += c.pw2(j) * cnt[j];
t2 += c.pw2(j) * N;
} else {
t2 += c.pw2(j) * cnt[j];
}
}
res += t1 * t2;
}
wt(res);
}
}
Current time: 2024年04月20日23時58分11秒
Last modified: 2021年01月02日16時12分17秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces Codeforces_Good_Bye_2020
トップページに戻る
Logged in as: unknown user (not login)