結果
問題 |
No.1189 Sum is XOR
|
ユーザー |
![]() |
提出日時 | 2020-08-27 18:13:58 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 576 bytes |
コンパイル時間 | 2,477 ms |
コンパイル使用メモリ | 193,732 KB |
最終ジャッジ日時 | 2025-01-13 15:24:58 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 RE * 8 |
ソースコード
#define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; #include <bits/stdc++.h> using namespace std; const ll MOD=998244353; ll dp[11][1024]; int main(){ ll n,k; cin>>n>>k; vector<ll> A(1024); ll x; rep(i,n){ cin>>x; A[x]++; } dp[0][0]=1; rep(i,10){ rep(j,1024){ for(int k=j+1;k<1024;k++){ if(j+k==(j^k) && j+k<1024) dp[i+1][j+k]=(dp[i+1][j+k]+dp[i][j]*A[k]%MOD)%MOD; } } } ll ans=0; rep(i,1024) ans=(ans+dp[k][i])%MOD; cout<<ans<<endl; return 0; }