結果

問題 No.641 Team Contest Estimation
ユーザー Lepton_sLepton_s
提出日時 2018-01-26 23:32:24
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 1,955 bytes
コンパイル時間 1,144 ms
コンパイル使用メモリ 119,364 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-27 19:54:23
合計ジャッジ時間 2,270 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<P,ll> PPI;
typedef pair<ll,P> PIP;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vp;
#define PQ(T) priority_queue<T,vector<T>,greater<T>>
#define PQ2(T) priority_queue<T>
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+9;
#define REP(i,a,b) for(ll (i)=a;(i)<(ll)(b);++(i))
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n+1)
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) ((x)=min((x),(y)))
#define chmax(x,y) ((x)=max((x),(y)))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
#define DEBUG(x) cerr<<"line ("<<__LINE__<<")  "<<#x<<": "<<x<<endl;
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	ll n, k;
	cin>>n>>k;
	vector<ll> a(n);
	rep(i, n) cin>>a[i];
	ll mu = (1LL<<(k-1))%mod*(((1LL<<k)-1)%mod)%mod*n%mod;
	ll sg = 0;
	rep(i, k){
		ll cnt = 0;
		rep(j, n) if(1&(a[j]>>i)) cnt++;
		ll df = abs(n-2*cnt);
		(df*=df)%=mod;
		(df*=(1LL<<i)%mod)%=mod;
		(df*=(1LL<<i)%mod)%=mod;
		(df*=(1LL<<(k-1))%mod)%=mod;
		(df*=(1LL<<(k-1))%mod)%=mod;
		(sg+=df)%=mod;
	}
	cout<<mu<<endl;
	cout<<sg<<endl;
	return 0;
}
0