結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー 👑 NachiaNachia
提出日時 2020-12-01 20:53:13
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 607 bytes
コンパイル時間 497 ms
コンパイル使用メモリ 32,132 KB
実行使用メモリ 19,416 KB
最終ジャッジ日時 2023-09-03 03:37:14
合計ジャッジ時間 9,189 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
19,356 KB
testcase_01 AC 26 ms
19,396 KB
testcase_02 AC 17 ms
19,396 KB
testcase_03 AC 100 ms
19,360 KB
testcase_04 AC 14 ms
19,352 KB
testcase_05 AC 12 ms
19,340 KB
testcase_06 AC 12 ms
19,408 KB
testcase_07 AC 13 ms
19,404 KB
testcase_08 AC 30 ms
19,368 KB
testcase_09 AC 13 ms
19,368 KB
testcase_10 AC 13 ms
19,408 KB
testcase_11 AC 14 ms
19,356 KB
testcase_12 AC 13 ms
19,356 KB
testcase_13 AC 12 ms
19,364 KB
testcase_14 AC 12 ms
19,356 KB
testcase_15 AC 12 ms
19,292 KB
testcase_16 AC 13 ms
19,340 KB
testcase_17 AC 19 ms
19,360 KB
testcase_18 AC 13 ms
19,396 KB
testcase_19 AC 11 ms
19,356 KB
testcase_20 AC 12 ms
19,360 KB
testcase_21 AC 19 ms
19,360 KB
testcase_22 AC 13 ms
19,364 KB
testcase_23 AC 13 ms
19,356 KB
testcase_24 AC 15 ms
19,404 KB
testcase_25 AC 46 ms
19,416 KB
testcase_26 AC 27 ms
19,340 KB
testcase_27 AC 29 ms
19,416 KB
testcase_28 AC 32 ms
19,400 KB
testcase_29 AC 24 ms
19,352 KB
testcase_30 AC 41 ms
19,396 KB
testcase_31 AC 59 ms
19,400 KB
testcase_32 AC 26 ms
19,408 KB
testcase_33 AC 41 ms
19,364 KB
testcase_34 AC 30 ms
19,412 KB
testcase_35 AC 34 ms
19,396 KB
testcase_36 AC 49 ms
19,416 KB
testcase_37 AC 38 ms
19,352 KB
testcase_38 AC 39 ms
19,356 KB
testcase_39 AC 75 ms
19,404 KB
testcase_40 AC 37 ms
19,300 KB
testcase_41 AC 59 ms
19,396 KB
testcase_42 AC 38 ms
19,400 KB
testcase_43 AC 37 ms
19,352 KB
testcase_44 AC 49 ms
19,396 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 RE -
06_evil_C_02 RE -
06_evil_C_03 RE -
06_evil_C_04 RE -
06_evil_C_05 RE -
06_evil_C_06 RE -
06_evil_C_07 RE -
06_evil_C_08 RE -
06_evil_C_09 RE -
06_evil_C_10 AC 3 ms
5,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.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 int Z=1024;
int N,K,X,Y;
int A[Z]={};
ULL dp[Z][Z]={};
ULL buf[Z][Z]={};

int main(){
  scanf("%d%d%d%d",&N,&K,&X,&Y);
  rep(i,K){ int a; scanf("%d",&a); A[a]=dp[a][a]=1; }
  rep(i,N-1){
    rep(x,Z){
      ULL S=0; rep(y,Z) S+=dp[x][y];
      rep(y,Z) if(A[y]) buf[x^y][y] = S-dp[x][y];
    }
    rep(x,Z) rep(y,Z){ dp[x][y]=buf[x][y]; buf[x][y]=0; }
  }

  ULL ans=0;
  rep(x,Z) rep(y,Z) if(X<=x && x<=Y) ans+=dp[x][y];
  printf("%lld\n",ans%998244353);

  return 0;
}
0