結果
問題 | No.1304 あなたは基本が何か知っていますか?私は知っています. |
ユーザー |
![]() |
提出日時 | 2020-12-01 01:58:59 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 939 bytes |
コンパイル時間 | 1,771 ms |
コンパイル使用メモリ | 116,272 KB |
最終ジャッジ日時 | 2025-01-16 10:46:32 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 22 WA * 13 RE * 24 TLE * 15 |
ソースコード
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<iomanip> #include<math.h> #include<complex> #include<queue> #include<deque> #include<stack> #include<map> #include<set> #include<bitset> #include<functional> #include<assert.h> #include<numeric> using namespace std; #define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i ) #define rep(i,n) REP(i,0,n) using ll = long long; constexpr int inf=1e9+7; constexpr ll longinf=1LL<<60 ; constexpr ll mod=998244353 ; ll dp[30][30][1024]; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n,k,x,y; cin>>n>>k>>x>>y; vector<int> a(k); rep(i,k)cin>>a[i]; dp[0][k][0]=1; rep(i,n){ rep(j,k){ rep(l,1024){ rep(t,k+1)if(t!=j)dp[i+1][j][l]+=dp[i][t][l^a[j]]; } } } ll ans = 0; rep(j,k)REP(t,x,y+1)ans+=dp[n][j][t]; cout<<ans%mod<<endl; return 0; }