結果
| 問題 |
No.1189 Sum is XOR
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-22 15:51:10 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 259 ms / 2,000 ms |
| コード長 | 425 bytes |
| コンパイル時間 | 581 ms |
| コンパイル使用メモリ | 64,128 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-15 10:00:24 |
| 合計ジャッジ時間 | 3,456 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
int N,K;
int dp[11][1<<10];
const int mod=998244353;
main()
{
cin>>N>>K;
if(K>10)
{
cout<<0<<endl;
return 0;
}
dp[0][0]=1;
for(int i=0;i<N;i++)
{
int A;cin>>A;
int T=((1<<10)-1)&~A;
for(int j=T;;j=j-1&T)
{
for(int k=0;k<K;k++)(dp[k+1][j|A]+=dp[k][j])%=mod;
if(j==0)break;
}
}
int ans=0;
for(int i=0;i<1<<10;i++)ans=(ans+dp[K][i])%mod;
cout<<ans<<endl;
}