結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー 👑 NachiaNachia
提出日時 2020-12-01 20:47:28
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 634 bytes
コンパイル時間 1,918 ms
コンパイル使用メモリ 199,344 KB
実行使用メモリ 39,604 KB
最終ジャッジ日時 2023-09-03 03:36:54
合計ジャッジ時間 36,097 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
26,892 KB
testcase_01 AC 24 ms
39,604 KB
testcase_02 AC 17 ms
27,168 KB
testcase_03 AC 99 ms
24,520 KB
testcase_04 AC 13 ms
26,840 KB
testcase_05 AC 12 ms
39,332 KB
testcase_06 AC 13 ms
24,140 KB
testcase_07 AC 13 ms
24,256 KB
testcase_08 AC 26 ms
24,248 KB
testcase_09 AC 13 ms
26,856 KB
testcase_10 AC 14 ms
26,876 KB
testcase_11 AC 14 ms
26,976 KB
testcase_12 AC 13 ms
26,904 KB
testcase_13 AC 12 ms
39,288 KB
testcase_14 AC 13 ms
24,260 KB
testcase_15 AC 14 ms
39,360 KB
testcase_16 AC 12 ms
20,064 KB
testcase_17 AC 21 ms
19,864 KB
testcase_18 AC 13 ms
19,752 KB
testcase_19 AC 12 ms
19,812 KB
testcase_20 AC 13 ms
19,744 KB
testcase_21 AC 20 ms
19,804 KB
testcase_22 AC 12 ms
19,804 KB
testcase_23 AC 14 ms
19,932 KB
testcase_24 AC 14 ms
19,788 KB
testcase_25 AC 48 ms
19,788 KB
testcase_26 AC 26 ms
19,800 KB
testcase_27 AC 28 ms
19,804 KB
testcase_28 AC 35 ms
19,936 KB
testcase_29 AC 27 ms
19,740 KB
testcase_30 AC 46 ms
19,868 KB
testcase_31 AC 67 ms
19,740 KB
testcase_32 AC 30 ms
19,740 KB
testcase_33 AC 52 ms
19,932 KB
testcase_34 AC 28 ms
19,796 KB
testcase_35 AC 39 ms
19,788 KB
testcase_36 AC 55 ms
19,752 KB
testcase_37 AC 41 ms
19,816 KB
testcase_38 AC 41 ms
19,812 KB
testcase_39 AC 68 ms
20,064 KB
testcase_40 AC 39 ms
19,736 KB
testcase_41 AC 69 ms
19,796 KB
testcase_42 AC 39 ms
20,064 KB
testcase_43 AC 42 ms
19,864 KB
testcase_44 AC 50 ms
19,740 KB
04_evil_A_01 RE -
04_evil_A_02 RE -
04_evil_A_03 RE -
04_evil_A_04 RE -
04_evil_A_05 RE -
04_evil_A_06 RE -
04_evil_A_07 RE -
04_evil_A_08 RE -
04_evil_A_09 RE -
04_evil_A_10 RE -
05_evil_B_01 RE -
05_evil_B_02 RE -
05_evil_B_03 RE -
05_evil_B_04 RE -
05_evil_B_05 RE -
05_evil_B_06 RE -
05_evil_B_07 RE -
05_evil_B_08 RE -
05_evil_B_09 RE -
05_evil_B_10 RE -
06_evil_C_01 TLE -
06_evil_C_02 TLE -
06_evil_C_03 TLE -
06_evil_C_04 TLE -
06_evil_C_05 TLE -
06_evil_C_06 TLE -
06_evil_C_07 TLE -
06_evil_C_08 TLE -
06_evil_C_09 TLE -
06_evil_C_10 AC 3 ms
12,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using ULL=unsigned long long;
#define rep(i,n) for(int i=0;i<(n);i++)

const LL M=998244353;
const int Z=1024;
int N,K,X,Y;
int A[Z]={};
LL dp[Z][Z];
LL buf[Z][Z];

int main(){
  cin>>N>>K>>X>>Y;
  rep(i,K){ int a; cin>>a; A[a]=dp[a][a]=1; }
  rep(i,N-1){
    rep(x,Z){
      LL S=0; rep(y,Z) S+=dp[x][y];
      rep(y,Z){
        if(!A[y]) continue;
        buf[x^y][y] = S-dp[x][y];
      }
    }
    rep(x,Z) rep(y,Z){ dp[x][y]=buf[x][y]; buf[x][y]=0; }
  }

  LL ans=0;
  rep(x,Z) rep(y,Z) if(X<=x && x<=Y) ans+=dp[x][y];
  ans%=M;
  cout<<ans<<endl;

  return 0;
}
0