結果

問題 No.641 Team Contest Estimation
ユーザー maspymaspy
提出日時 2020-04-09 22:42:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 438 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 38,072 KB
最終ジャッジ日時 2023-10-12 00:17:42
合計ジャッジ時間 6,626 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
29,508 KB
testcase_01 AC 131 ms
29,512 KB
testcase_02 AC 131 ms
29,412 KB
testcase_03 RE -
testcase_04 AC 133 ms
29,440 KB
testcase_05 AC 182 ms
38,072 KB
testcase_06 AC 169 ms
38,068 KB
testcase_07 AC 167 ms
37,844 KB
testcase_08 AC 166 ms
38,052 KB
testcase_09 AC 131 ms
29,560 KB
testcase_10 AC 131 ms
29,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

N, K = map(int, readline().split())
A = np.array(read().split(), np.int64)

mu = ((1 << K) - 1) * N << K - 1
sigma = 0
for i in range(K):
    x = int(np.sum((A >> i) & 1))
    y = N - x
    sigma += (1 << i + i) * (x - y) ** 2

sigma <<= K + K - 2

MOD = 10 ** 9 + 9
print(mu % MOD)
print(sigma % MOD)
0