結果
| 問題 |
No.1189 Sum is XOR
|
| コンテスト | |
| ユーザー |
Rho
|
| 提出日時 | 2020-08-01 22:50:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 821 bytes |
| コンパイル時間 | 1,752 ms |
| コンパイル使用メモリ | 166,604 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-16 00:59:04 |
| 合計ジャッジ時間 | 8,187 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | RE * 21 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define vi vector<int>
#define all(a) a.begin(),a.end()
typedef pair<int,int> P;
const long long mod=998244353;
const long long inf=1ll<<61;
const int maxN=100;
int a[105];
int dp[102][102][1024];
signed main(){
int n,l;cin>>n>>l;
rep(i,n)cin>>a[i];
dp[0][0][0]=1;
rep(i,n){
rep(j,l+1){
rep(l,1<<10){
if(!dp[i][j][l])continue;
dp[i+1][j][l]+=dp[i][j][l];
dp[i+1][j][l]%=mod;
if(!(l&a[i])){
dp[i+1][j+1][l|a[i]]+=dp[i][j][l];
dp[i+1][j+1][l|a[i]]%=mod;
}
}
}
}
int sum=0;
rep(i,1<<10)sum+=dp[n][l][i];
cout<<sum%mod<<endl;
}
Rho