結果

問題 No.641 Team Contest Estimation
ユーザー square1001square1001
提出日時 2017-12-28 20:09:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 514 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 37,712 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-26 19:34:04
合計ジャッジ時間 1,261 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cmath>
#include <cstdio>
#define sqr(x) (x * x % mod)
int N, K, c[66], mod = 1000000009; long long a;
int main() {
	scanf("%d%d", &N, &K);
	for (int i = 0; i < N; i++) {
		scanf("%lld", &a);
		for (int j = 0; j < K; j++) c[j] += (a >> j) & 1;
	}
	int var = 0;
	for (int i = 0; i < K; i++) var = (var + sqr(1LL * abs(N - c[i] * 2) * ((1LL << i) % mod) % mod)) % mod;
	printf("%d\n", (int)(K == 0 ? 0 : (1LL << (K - 1)) % mod * (((1LL << K) - 1) % mod) % mod * N % mod));
	printf("%d\n", var);
	return 0;
}
0